Fix model device in code example (#4)
Browse files- Fix model device in code example (02bda2ccbdc90faf06bebe95175e2a9f5f75be5c)
Co-authored-by: Lewis Tunstall <lewtun@users.noreply.huggingface.co>
README.md
CHANGED
@@ -225,7 +225,7 @@ checkpoint = "bigcode/santacoder"
|
|
225 |
device = "cuda" # for GPU usage or "cpu" for CPU usage
|
226 |
|
227 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
228 |
-
model = AutoModelForCausalLM.from_pretrained(checkpoint, trust_remote_code=True).to()
|
229 |
|
230 |
inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
|
231 |
outputs = model.generate(inputs)
|
|
|
225 |
device = "cuda" # for GPU usage or "cpu" for CPU usage
|
226 |
|
227 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
228 |
+
model = AutoModelForCausalLM.from_pretrained(checkpoint, trust_remote_code=True).to(device)
|
229 |
|
230 |
inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
|
231 |
outputs = model.generate(inputs)
|