ProphetOfBostrom commited on
Commit
348a226
1 Parent(s): 4a8b075

readme fixed

Browse files
Files changed (1) hide show
  1. README.md +331 -0
README.md CHANGED
@@ -2,4 +2,335 @@
2
  license: other
3
  license_name: yi-license
4
  license_link: https://huggingface.co/01-ai/Yi-34B/blob/main/LICENSE
 
 
 
 
 
 
 
 
 
 
5
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: other
3
  license_name: yi-license
4
  license_link: https://huggingface.co/01-ai/Yi-34B/blob/main/LICENSE
5
+ language:
6
+ - en
7
+ pipeline_tag: text-generation
8
+ tags:
9
+ - unsloth
10
+ - axolotl
11
+ - exllamav2
12
+ - exl2
13
+ - 4bit
14
+ library_name: transformers
15
  ---
16
+
17
+ ## quantized with the default exl2 dataset with sequence lengths of 8192 and 400 calibration lines instead of 100. possibly microwaved, presumably better.
18
+ ## tokenizer works. tokenizer.model is not required and may (is 100%) actually missing the working tokens.
19
+
20
+ # DreamGen Opus V1
21
+
22
+ <div style="display: flex; flex-direction: row; align-items: center;">
23
+ <img src="/dreamgen/opus-v1-34b/resolve/main/images/logo-1024.png" alt="model logo" style="
24
+ border-radius: 12px;
25
+ margin-right: 12px;
26
+ margin-top: 0px;
27
+ margin-bottom: 0px;
28
+ max-width: 100px;
29
+ height: auto;
30
+ "/>
31
+
32
+ Models for **(steerable) story-writing and role-playing**.
33
+ <br/>[All Opus V1 models, including quants](https://huggingface.co/collections/dreamgen/opus-v1-65d092a6f8ab7fc669111b31).
34
+
35
+ </div>
36
+
37
+ ## Resources
38
+
39
+ - [**Opus V1 prompting guide**](https://dreamgen.com/docs/models/opus/v1) with many (interactive) examples and prompts that you can copy.
40
+ - [**Google Colab**](https://colab.research.google.com/drive/1J178fH6IdQOXNi-Njgdacf5QgAxsdT20?usp=sharing) for interactive role-play using `opus-v1.2-7b`.
41
+ - [Python code](example/prompt/format.py) to format the prompt correctly.
42
+
43
+ <img src="/dreamgen/opus-v1-34b/resolve/main/images/story_writing.webp" alt="story writing on dreamgen.com" style="
44
+ padding: 12px;
45
+ border-radius: 12px;
46
+ border: 2px solid #f9a8d4;
47
+ background: rgb(9, 9, 11);
48
+ "/>
49
+
50
+ ## Prompting
51
+
52
+ <details>
53
+ <summary>The models use an extended version of ChatML.</summary>
54
+
55
+ ```
56
+ <|im_start|>system
57
+ (Story description in the right format here)
58
+ (Typically consists of plot description, style description and characters)<|im_end|>
59
+ <|im_start|>user
60
+ (Your instruction on how the story should continue)<|im_end|>
61
+ <|im_start|>text names= Alice
62
+ (Continuation of the story from the Alice character)<|im_end|>
63
+ <|im_start|>text
64
+ (Continuation of the story from no character in particular (pure narration))<|im_end|>
65
+ <|im_start|>user
66
+ (Your instruction on how the story should continue)<|im_end|>
67
+ <|im_start|>text names= Bob
68
+ (Continuation of the story from the Bob character)<|im_end|>
69
+ ```
70
+
71
+ The Opus V1 extension is the addition of the `text` role, and the addition / modification of role names.
72
+
73
+ Pay attention to the following:
74
+
75
+ - The `text` messages can (but don't have to have) `names`, names are used to indicate the "active" character during role-play.
76
+ - There can be multiple subsequent message with a `text` role, especially if names are involved.
77
+ - There can be multiple names attached to a message.
78
+ - The format for names is `names= {{name[0]}}; {{name[1]}}`, beware of the spaces after `names=` and after the `;`. This spacing leads to most natural tokenization for the names.
79
+ </details>
80
+
81
+ While the main goal for the models is great story-writing and role-playing performance, the models are also capable of several writing related tasks as well as general assistance.
82
+
83
+ Here's how you can prompt the model for the following tasks
84
+
85
+ - Steerable [Story-writing](https://dreamgen.com/docs/models/opus/v1#task-story-writing) and [Role-playing](https://dreamgen.com/docs/models/opus/v1#task-role-playing):
86
+ - Input:
87
+ - System prompt: You provide story / role-play description, which consists of:
88
+ - Plot description
89
+ - Style description
90
+ - Characters and their descriptions
91
+ - Conversation turns:
92
+ - Text / message turn: This represents part of the story or role play
93
+ - Instruction: This tells the model what should happen next
94
+ - Output: Continuation of the story / role-play.
95
+ - [Story plot summarization](https://dreamgen.com/docs/models/opus/v1#task-plot-description)
96
+ - Input: A story, or a few chapters of a story.
97
+ - Output: A description of the story or chapters.
98
+ - [Story character description](https://dreamgen.com/docs/models/opus/v1#task-char-description)
99
+ - Input: A story, or a few chapters of a story, set of characters.
100
+ - Output: A description of the characters.
101
+ - [Story style description](https://dreamgen.com/docs/models/opus/v1#task-style-description)
102
+ - Input: A story, or a few chapters of a story.
103
+ - Output: A description the style of the story.
104
+ - [Story description to chapters](https://dreamgen.com/docs/models/opus/v1#task-story-description-to-chapter-descriptions)
105
+ - Input: A brief plot description and the desired number of chapters.
106
+ - Output: A description for each chapter.
107
+ - And more...
108
+
109
+ ### Sampling params
110
+
111
+ For story-writing and role-play, I recommend "Min P" based sampling with `min_p` in the range `[0.01, 0.1]` and with `temperature` in the range `[0.5, 1.5]`, depending on your preferences. A good starting point would be `min_p=0.1; temperature=0.8`.
112
+
113
+ You may also benefit from setting presence, frequency and repetition penalties, especially at lower temperatures.
114
+
115
+ ## Dataset
116
+
117
+ The fine-tuning dataset consisted of ~100M tokens of steerable story-writing, role-playing, writing-assistant and general-assistant examples. Each example was up to 31000 tokens long.
118
+
119
+ All story-writing and role-playing examples were based on human-written text.
120
+
121
+ ![token count distribution](images/token_count_cum__token_bucket.png)
122
+
123
+ ## Running the model
124
+
125
+ The model is should be compatible with any software that supports the base model, but beware of prompting and tokenization.
126
+
127
+ I recommend using these model versions:
128
+
129
+ - 7B: [no quant (opus-v1.2-7b)](https://huggingface.co/dreamgen/opus-v1.2-7b)
130
+ - 34B: [no quant (opus-v1-34b)](https://huggingface.co/dreamgen/opus-v1-34b) or [awq (opus-v1-34b-awq)](https://huggingface.co/dreamgen/opus-v1-34b-awq)
131
+
132
+ ### Running on DreamGen.com (free)
133
+
134
+ You can try the model for free on [dreamgen.com](https://dreamgen.com) — note that an account is required.
135
+
136
+ ### Running Locally
137
+
138
+ - **Make sure your prompt is as close as possible to the Opus V1**
139
+ - Regardless of which backend you use, it's important that you format your prompt well and that the tokenization works correctly.
140
+ - [Read the prompt guide](https://dreamgen.com/docs/models/opus/v1)
141
+ - [Read the prompt formatting code](example/prompt/format.py)
142
+ - Make sure `<|im_start|>` and `<|im_end|>` are tokenized correctly
143
+ - **vLLM**
144
+ - [**Google Colab**](https://colab.research.google.com/drive/1J178fH6IdQOXNi-Njgdacf5QgAxsdT20?usp=sharing): This is a simple interactive Google Colab to do role-play with the 7B model, it should fit on the T4 GPU.
145
+ - [Code](example/prompt/interactive.py): This is simple script for interactive chat for one hard-coded scenario.
146
+ - **SillyTavern**
147
+ - [Settings](https://huggingface.co/{{REPO_ID}}/tree/main/configs/silly_tavern), v2 kindly provided by @MarinaraSpaghetti
148
+ - [Settings screenshot](configs/silly_tavern/settings_screenshot.webp)
149
+ - This is just an attempt at approximating the Opus V1 prompt, it won't be perfect
150
+ - **LM Studio**
151
+ - [Config](configs/lmstudio/preset.json)
152
+ - Just like ChatML, just changed "assistant" to "text" role.
153
+ - **HuggingFace**
154
+ - [Chat template](tokenizer_config.json#L51)
155
+ - Just like ChatML, just changed "assistant" to "text" role.
156
+
157
+ ## Known Issues
158
+
159
+ - **34B tokenization**:
160
+ - There seems to be a mismatch between the tokenizer of the base and fine-tuned model. It's unclear whether this also affected training, or whether it's just incorrectly saved tokenizer (you can see `tokenizer.json` was not saved ([bug report](https://github.com/OpenAccess-AI-Collective/axolotl/issues/1322))).
161
+ - This affects BOS and EOS (which aren't really used by Yi) and the tokenization of the first input token.
162
+ - Overall impact should be minor.
163
+ - **34B repetition**:
164
+ - The 34B sometimes gets stuck repeating the same word, or synonyms. This seems to be a common problem across various Yi 34B fine-tunes.
165
+ - **GGUF**:
166
+ - The conversion might be messed up and in my tests even `Q_8` of the `opus-v1.2-7b` is much worse than the `fp16` version.
167
+ - **Ooba**:
168
+ - The tokenization might be messed up. Some users reported that `<|im_start|>` and `<|im_end|>` are tokenized as multiple tokens.
169
+
170
+ ## Community
171
+
172
+ Join the DreamGen community on [**Discord**](https://dreamgen.com/discord) to get early access to new models.
173
+
174
+ ## License
175
+
176
+ - This model is intended for personal use only, other use is not permitted.
177
+
178
+ ---
179
+
180
+ # DreamGen Opus V1
181
+
182
+ <div style="display: flex; flex-direction: row; align-items: center;">
183
+ <img src="/dreamgen/opus-v1-34b/resolve/main/images/logo-1024.png" alt="model logo" style="
184
+ border-radius: 12px;
185
+ margin-right: 12px;
186
+ margin-top: 0px;
187
+ margin-bottom: 0px;
188
+ max-width: 100px;
189
+ height: auto;
190
+ "/>
191
+
192
+ Models for **(steerable) story-writing and role-playing**.
193
+ <br/>[All Opus V1 models, including quants](https://huggingface.co/collections/dreamgen/opus-v1-65d092a6f8ab7fc669111b31).
194
+
195
+ </div>
196
+
197
+ ## Resources
198
+
199
+ - [**Opus V1 prompting guide**](https://dreamgen.com/docs/models/opus/v1) with many (interactive) examples and prompts that you can copy.
200
+ - [**Google Colab**](https://colab.research.google.com/drive/1J178fH6IdQOXNi-Njgdacf5QgAxsdT20?usp=sharing) for interactive role-play using `opus-v1.2-7b`.
201
+ - [Python code](example/prompt/format.py) to format the prompt correctly.
202
+
203
+ <img src="/dreamgen/opus-v1-34b/resolve/main/images/story_writing.webp" alt="story writing on dreamgen.com" style="
204
+ padding: 12px;
205
+ border-radius: 12px;
206
+ border: 2px solid #f9a8d4;
207
+ background: rgb(9, 9, 11);
208
+ "/>
209
+
210
+ ## Prompting
211
+
212
+ <details>
213
+ <summary>The models use an extended version of ChatML.</summary>
214
+
215
+ ```
216
+ <|im_start|>system
217
+ (Story description in the right format here)
218
+ (Typically consists of plot description, style description and characters)<|im_end|>
219
+ <|im_start|>user
220
+ (Your instruction on how the story should continue)<|im_end|>
221
+ <|im_start|>text names= Alice
222
+ (Continuation of the story from the Alice character)<|im_end|>
223
+ <|im_start|>text
224
+ (Continuation of the story from no character in particular (pure narration))<|im_end|>
225
+ <|im_start|>user
226
+ (Your instruction on how the story should continue)<|im_end|>
227
+ <|im_start|>text names= Bob
228
+ (Continuation of the story from the Bob character)<|im_end|>
229
+ ```
230
+
231
+ The Opus V1 extension is the addition of the `text` role, and the addition / modification of role names.
232
+
233
+ Pay attention to the following:
234
+
235
+ - The `text` messages can (but don't have to have) `names`, names are used to indicate the "active" character during role-play.
236
+ - There can be multiple subsequent message with a `text` role, especially if names are involved.
237
+ - There can be multiple names attached to a message.
238
+ - The format for names is `names= {{name[0]}}; {{name[1]}}`, beware of the spaces after `names=` and after the `;`. This spacing leads to most natural tokenization for the names.
239
+ </details>
240
+
241
+ While the main goal for the models is great story-writing and role-playing performance, the models are also capable of several writing related tasks as well as general assistance.
242
+
243
+ Here's how you can prompt the model for the following tasks
244
+
245
+ - Steerable [Story-writing](https://dreamgen.com/docs/models/opus/v1#task-story-writing) and [Role-playing](https://dreamgen.com/docs/models/opus/v1#task-role-playing):
246
+ - Input:
247
+ - System prompt: You provide story / role-play description, which consists of:
248
+ - Plot description
249
+ - Style description
250
+ - Characters and their descriptions
251
+ - Conversation turns:
252
+ - Text / message turn: This represents part of the story or role play
253
+ - Instruction: This tells the model what should happen next
254
+ - Output: Continuation of the story / role-play.
255
+ - [Story plot summarization](https://dreamgen.com/docs/models/opus/v1#task-plot-description)
256
+ - Input: A story, or a few chapters of a story.
257
+ - Output: A description of the story or chapters.
258
+ - [Story character description](https://dreamgen.com/docs/models/opus/v1#task-char-description)
259
+ - Input: A story, or a few chapters of a story, set of characters.
260
+ - Output: A description of the characters.
261
+ - [Story style description](https://dreamgen.com/docs/models/opus/v1#task-style-description)
262
+ - Input: A story, or a few chapters of a story.
263
+ - Output: A description the style of the story.
264
+ - [Story description to chapters](https://dreamgen.com/docs/models/opus/v1#task-story-description-to-chapter-descriptions)
265
+ - Input: A brief plot description and the desired number of chapters.
266
+ - Output: A description for each chapter.
267
+ - And more...
268
+
269
+ ### Sampling params
270
+
271
+ For story-writing and role-play, I recommend "Min P" based sampling with `min_p` in the range `[0.01, 0.1]` and with `temperature` in the range `[0.5, 1.5]`, depending on your preferences. A good starting point would be `min_p=0.1; temperature=0.8`.
272
+
273
+ You may also benefit from setting presence, frequency and repetition penalties, especially at lower temperatures.
274
+
275
+ ## Dataset
276
+
277
+ The fine-tuning dataset consisted of ~100M tokens of steerable story-writing, role-playing, writing-assistant and general-assistant examples. Each example was up to 31000 tokens long.
278
+
279
+ All story-writing and role-playing examples were based on human-written text.
280
+
281
+ ![token count distribution](images/token_count_cum__token_bucket.png)
282
+
283
+ ## Running the model
284
+
285
+ The model is should be compatible with any software that supports the base model, but beware of prompting and tokenization.
286
+
287
+ I recommend using these model versions:
288
+
289
+ - 7B: [no quant (opus-v1.2-7b)](https://huggingface.co/dreamgen/opus-v1.2-7b)
290
+ - 34B: [no quant (opus-v1-34b)](https://huggingface.co/dreamgen/opus-v1-34b) or [awq (opus-v1-34b-awq)](https://huggingface.co/dreamgen/opus-v1-34b-awq)
291
+
292
+ ### Running on DreamGen.com (free)
293
+
294
+ You can try the model for free on [dreamgen.com](https://dreamgen.com) — note that an account is required.
295
+
296
+ ### Running Locally
297
+
298
+ - **Make sure your prompt is as close as possible to the Opus V1**
299
+ - Regardless of which backend you use, it's important that you format your prompt well and that the tokenization works correctly.
300
+ - [Read the prompt guide](https://dreamgen.com/docs/models/opus/v1)
301
+ - [Read the prompt formatting code](example/prompt/format.py)
302
+ - Make sure `<|im_start|>` and `<|im_end|>` are tokenized correctly
303
+ - **vLLM**
304
+ - [**Google Colab**](https://colab.research.google.com/drive/1J178fH6IdQOXNi-Njgdacf5QgAxsdT20?usp=sharing): This is a simple interactive Google Colab to do role-play with the 7B model, it should fit on the T4 GPU.
305
+ - [Code](example/prompt/interactive.py): This is simple script for interactive chat for one hard-coded scenario.
306
+ - **SillyTavern**
307
+ - [Settings](https://huggingface.co/{{REPO_ID}}/tree/main/configs/silly_tavern), v2 kindly provided by @MarinaraSpaghetti
308
+ - [Settings screenshot](configs/silly_tavern/settings_screenshot.webp)
309
+ - This is just an attempt at approximating the Opus V1 prompt, it won't be perfect
310
+ - **LM Studio**
311
+ - [Config](configs/lmstudio/preset.json)
312
+ - Just like ChatML, just changed "assistant" to "text" role.
313
+ - **HuggingFace**
314
+ - [Chat template](tokenizer_config.json#L51)
315
+ - Just like ChatML, just changed "assistant" to "text" role.
316
+
317
+ ## Known Issues
318
+
319
+ - **34B tokenization**:
320
+ - There seems to be a mismatch between the tokenizer of the base and fine-tuned model. It's unclear whether this also affected training, or whether it's just incorrectly saved tokenizer (you can see `tokenizer.json` was not saved ([bug report](https://github.com/OpenAccess-AI-Collective/axolotl/issues/1322))).
321
+ - This affects BOS and EOS (which aren't really used by Yi) and the tokenization of the first input token.
322
+ - Overall impact should be minor.
323
+ - **34B repetition**:
324
+ - The 34B sometimes gets stuck repeating the same word, or synonyms. This seems to be a common problem across various Yi 34B fine-tunes.
325
+ - **GGUF**:
326
+ - The conversion might be messed up and in my tests even `Q_8` of the `opus-v1.2-7b` is much worse than the `fp16` version.
327
+ - **Ooba**:
328
+ - The tokenization might be messed up. Some users reported that `<|im_start|>` and `<|im_end|>` are tokenized as multiple tokens.
329
+
330
+ ## Community
331
+
332
+ Join the DreamGen community on [**Discord**](https://dreamgen.com/discord) to get early access to new models.
333
+
334
+ ## License
335
+
336
+ - This model is intended for personal use only, other use is not permitted.