banghua commited on
Commit
07a85fd
1 Parent(s): 16019ae

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +17 -0
README.md CHANGED
@@ -58,6 +58,23 @@ For more detailed discussions, please check out our [blog post](https://starling
58
  Our model follows the exact chat template and usage as [Openchat 3.5](https://huggingface.co/openchat/openchat_3.5). Please refer to their model card for more details.
59
  In addition, our model is hosted on LMSYS [Chatbot Arena](https://chat.lmsys.org) for free test.
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
 
63
  ## License
 
58
  Our model follows the exact chat template and usage as [Openchat 3.5](https://huggingface.co/openchat/openchat_3.5). Please refer to their model card for more details.
59
  In addition, our model is hosted on LMSYS [Chatbot Arena](https://chat.lmsys.org) for free test.
60
 
61
+ The conversation template is the same as Openchat 3.5:
62
+ ```
63
+ import transformers
64
+ tokenizer = transformers.AutoTokenizer.from_pretrained("openchat/openchat_3.5")
65
+
66
+ # Single-turn
67
+ tokens = tokenizer("GPT4 Correct User: Hello<|end_of_turn|>GPT4 Correct Assistant:").input_ids
68
+ assert tokens == [1, 420, 6316, 28781, 3198, 3123, 1247, 28747, 22557, 32000, 420, 6316, 28781, 3198, 3123, 21631, 28747]
69
+
70
+ # Multi-turn
71
+ tokens = tokenizer("GPT4 Correct User: Hello<|end_of_turn|>GPT4 Correct Assistant: Hi<|end_of_turn|>GPT4 Correct User: How are you today?<|end_of_turn|>GPT4 Correct Assistant:").input_ids
72
+ assert tokens == [1, 420, 6316, 28781, 3198, 3123, 1247, 28747, 22557, 32000, 420, 6316, 28781, 3198, 3123, 21631, 28747, 15359, 32000, 420, 6316, 28781, 3198, 3123, 1247, 28747, 1602, 460, 368, 3154, 28804, 32000, 420, 6316, 28781, 3198, 3123, 21631, 28747]
73
+
74
+ # Coding Mode
75
+ tokens = tokenizer("Code User: Implement quicksort using C++<|end_of_turn|>Code Assistant:").input_ids
76
+ assert tokens == [1, 7596, 1247, 28747, 26256, 2936, 7653, 1413, 334, 1680, 32000, 7596, 21631, 28747]
77
+ ```
78
 
79
 
80
  ## License