Update README.md
Browse files
README.md
CHANGED
|
@@ -65,6 +65,26 @@ if __name__ == "__main__":
|
|
| 65 |
print(completion)
|
| 66 |
```
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
# MT-bench / heval
|
| 69 |
|
| 70 |

|
|
|
|
| 65 |
print(completion)
|
| 66 |
```
|
| 67 |
|
| 68 |
+
# Chat template
|
| 69 |
+
|
| 70 |
+
The model uses the same chat template as found in Mistral instruct models:
|
| 71 |
+
|
| 72 |
+
```python
|
| 73 |
+
text = "<|endoftext|>[INST] What is your favourite condiment? [/INST]"
|
| 74 |
+
"Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!</s> "
|
| 75 |
+
"[INST] Do you have mayonnaise recipes? [/INST]"
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
You don't need to do it manually if you use the HF transformers tokenizer:
|
| 79 |
+
|
| 80 |
+
```python
|
| 81 |
+
messages = [
|
| 82 |
+
{"role": "user", "content": "Hello, who are you?"},
|
| 83 |
+
{"role": "assistant": "content": "I am ..."}
|
| 84 |
+
]
|
| 85 |
+
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
# MT-bench / heval
|
| 89 |
|
| 90 |

|