From 518524f4580c6fb410044aa347b1ede5fd157a65 Mon Sep 17 00:00:00 2001 From: Daniel Gross Date: Sun, 23 Jul 2023 10:41:03 -0700 Subject: [PATCH 1/2] default to whatever system has --- sample.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample.py b/sample.py index 2038a63..040bc14 100644 --- a/sample.py +++ b/sample.py @@ -17,7 +17,7 @@ max_new_tokens = 100 # number of tokens generated in each sample temperature = 1.0 # 1.0 = no change, < 1.0 = less random, > 1.0 = more random, in predictions top_k = 300 # retain only the top_k most likely tokens, clamp others to have 0 probability seed = 1337 -device = 'cuda' # examples: 'cpu', 'cuda', 'cuda:0', 'cuda:1', etc. +device = 'cuda' if torch.cuda.is_available() else 'cpu' # examples: 'cpu', 'cuda', 'cuda:0', 'cuda:1', etc. #dtype = 'bfloat16' if torch.cuda.is_available() and torch.cuda.is_bf16_supported() else 'float16' # 'float32' or 'bfloat16' or 'float16' dtype = "float32" compile = False # use PyTorch 2.0 to compile the model to be faster From 8c383c28f9cbbe311858ec715207bfc3eab27523 Mon Sep 17 00:00:00 2001 From: Daniel Gross Date: Sun, 23 Jul 2023 10:46:36 -0700 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff3f7d5..5037087 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ But note that this only emits the SentencePiece tokens. To decode the tokens int python run_wrap.py ``` -Watch the tokens stream by, fun! We can also run the PyTorch inference script for comparison: +Watch the tokens stream by, fun! We can also run the PyTorch inference script for comparison (to run, add [model.ckpt](https://drive.google.com/file/d/1SM0rMxzy7babB-v4MfTg1GFqOCgWar5w/view?usp=share_link) to /out if you haven't already): ```bash python sample.py @@ -92,7 +92,7 @@ Which gives the same results. More detailed testing will be done in `test_all.py $ pytest ``` -Currently you will need two files to run the test: the [model.bin](https://drive.google.com/file/d/1aTimLdx3JktDXxcHySNrZJOOk8Vb1qBR/view?usp=share_link) file and the [model.ckpt](https://drive.google.com/file/d/1SM0rMxzy7babB-v4MfTg1GFqOCgWar5w/view?usp=share_link) file from PyTorch training I ran earlier. I have to think through running the tests without having to download 200MB of data. +Currently you will need two files to test or sample: the [model.bin](https://drive.google.com/file/d/1aTimLdx3JktDXxcHySNrZJOOk8Vb1qBR/view?usp=share_link) file and the [model.ckpt](https://drive.google.com/file/d/1SM0rMxzy7babB-v4MfTg1GFqOCgWar5w/view?usp=share_link) file from PyTorch training I ran earlier. I have to think through running the tests without having to download 200MB of data. ## unsorted todos