Update README.md
Browse files
README.md
CHANGED
@@ -38,7 +38,7 @@ model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=compute_d
|
|
38 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
39 |
|
40 |
chat = tokenizer.apply_chat_template([{"role":"user", "content":"What is 1.5+102.2?"}], tokenize=True, add_generation_prompt=True, return_tensors="pt")
|
41 |
-
outputs =
|
42 |
print(tokenizer.decode(outputs[0]))
|
43 |
```
|
44 |
|
|
|
38 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
39 |
|
40 |
chat = tokenizer.apply_chat_template([{"role":"user", "content":"What is 1.5+102.2?"}], tokenize=True, add_generation_prompt=True, return_tensors="pt")
|
41 |
+
outputs = model.generate(chat.to(device), max_new_tokens=1024, do_sample=True)
|
42 |
print(tokenizer.decode(outputs[0]))
|
43 |
```
|
44 |
|