Update README.md
Browse files
README.md
CHANGED
|
@@ -87,10 +87,7 @@ messages = [
|
|
| 87 |
{'role': 'user', 'content': 'Hi, can you tell me the current stock price of AAPL?'}
|
| 88 |
]
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
model_inputs = encodeds.to(device)
|
| 93 |
-
model.to(device)
|
| 94 |
|
| 95 |
generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
|
| 96 |
decoded = tokenizer.batch_decode(generated_ids)
|
|
|
|
| 87 |
{'role': 'user', 'content': 'Hi, can you tell me the current stock price of AAPL?'}
|
| 88 |
]
|
| 89 |
|
| 90 |
+
model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
|
| 93 |
decoded = tokenizer.batch_decode(generated_ids)
|