abacaj commited on
Commit
ea86eb0
1 Parent(s): b12bd5c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +20 -0
README.md CHANGED
@@ -65,6 +65,26 @@ if __name__ == "__main__":
65
  print(completion)
66
  ```
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  # MT-bench / heval
69
 
70
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/62ceeb27e7f6014c0e9d9268/lnFu3x1ufdpQVysIrX4-G.png)
 
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
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/62ceeb27e7f6014c0e9d9268/lnFu3x1ufdpQVysIrX4-G.png)