Update README.md
Browse files
README.md
CHANGED
|
@@ -184,27 +184,14 @@ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
|
| 184 |
### Multi-Turn Inference Example
|
| 185 |
|
| 186 |
```python
|
| 187 |
-
|
| 188 |
"User: hi\\n"
|
| 189 |
"AI: hello\\n"
|
| 190 |
"User: how are you\\n"
|
| 191 |
"AI: good u?\\n"
|
| 192 |
-
"User: also good\n"
|
| 193 |
"AI:"
|
| 194 |
)
|
| 195 |
-
|
| 196 |
-
inputs = tokenizer(conversation, return_tensors="pt")
|
| 197 |
-
|
| 198 |
-
outputs = model.generate(
|
| 199 |
-
**inputs,
|
| 200 |
-
max_new_tokens=50,
|
| 201 |
-
do_sample=True,
|
| 202 |
-
temperature=0.8,
|
| 203 |
-
top_p=0.9
|
| 204 |
-
)
|
| 205 |
-
|
| 206 |
-
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 207 |
-
print(response)
|
| 208 |
```
|
| 209 |
|
| 210 |
---
|
|
|
|
| 184 |
### Multi-Turn Inference Example
|
| 185 |
|
| 186 |
```python
|
| 187 |
+
input_text = (
|
| 188 |
"User: hi\\n"
|
| 189 |
"AI: hello\\n"
|
| 190 |
"User: how are you\\n"
|
| 191 |
"AI: good u?\\n"
|
| 192 |
+
"User: also good, what is 2+2?\n"
|
| 193 |
"AI:"
|
| 194 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
```
|
| 196 |
|
| 197 |
---
|