LoneStriker commited on
Commit
342db1b
1 Parent(s): 3f88595

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -1,35 +1,5 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
1
+ opus-v1.2-llama-3-8b-Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
2
+ opus-v1.2-llama-3-8b-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
3
+ opus-v1.2-llama-3-8b-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
4
+ opus-v1.2-llama-3-8b-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
5
+ opus-v1.2-llama-3-8b-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md ADDED
@@ -0,0 +1,243 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - unsloth
7
+ - axolotl
8
+ license: cc-by-nc-nd-4.0
9
+ ---
10
+
11
+ # Llama 3 DreamGen Opus V1
12
+
13
+ <div style="display: flex; flex-direction: row; align-items: center;">
14
+ <img src="/dreamgen/opus-v1.2-llama-3-8b/resolve/main/images/logo-1024.png" alt="model logo" style="
15
+ border-radius: 12px;
16
+ margin-right: 12px;
17
+ margin-top: 0px;
18
+ margin-bottom: 0px;
19
+ max-width: 100px;
20
+ height: auto;
21
+ "/>
22
+
23
+ Models for **(steerable) story-writing and role-playing**.
24
+ <br/>[All Opus V1 models, including quants](https://huggingface.co/collections/dreamgen/opus-v1-65d092a6f8ab7fc669111b31).
25
+
26
+ </div>
27
+
28
+ ## Resources
29
+
30
+ - [**Opus V1 prompting guide**](https://dreamgen.com/docs/models/opus/v1) with many (interactive) examples and prompts that you can copy.
31
+ - [**Google Colab**](https://colab.research.google.com/drive/1J178fH6IdQOXNi-Njgdacf5QgAxsdT20?usp=sharing) for interactive role-play using `opus-v1.2-7b`.
32
+ - [Python code](example/prompt/format.py) to format the prompt correctly.
33
+ - Join the community on [**Discord**](https://dreamgen.com/discord) to get early access to new models.
34
+
35
+ <img src="/dreamgen/opus-v1.2-llama-3-8b/resolve/main/images/story_writing.webp" alt="story writing on dreamgen.com" style="
36
+ padding: 12px;
37
+ border-radius: 12px;
38
+ border: 2px solid #f9a8d4;
39
+ background: rgb(9, 9, 11);
40
+ "/>
41
+
42
+ ## Prompting
43
+
44
+ <details>
45
+ <summary>The models use an extended version of ChatML.</summary>
46
+
47
+ ```
48
+ <|im_start|>system
49
+ (Story description in the right format here)
50
+ (Typically consists of plot description, style description and characters)<|im_end|>
51
+ <|im_start|>user
52
+ (Your instruction on how the story should continue)<|im_end|>
53
+ <|im_start|>text names= Alice
54
+ (Continuation of the story from the Alice character)<|im_end|>
55
+ <|im_start|>text
56
+ (Continuation of the story from no character in particular (pure narration))<|im_end|>
57
+ <|im_start|>user
58
+ (Your instruction on how the story should continue)<|im_end|>
59
+ <|im_start|>text names= Bob
60
+ (Continuation of the story from the Bob character)<|im_end|>
61
+ ```
62
+
63
+ The Opus V1 extension is the addition of the `text` role, and the addition / modification of role names.
64
+
65
+ Pay attention to the following:
66
+
67
+ - The `text` messages can (but don't have to have) `names`, names are used to indicate the "active" character during role-play.
68
+ - There can be multiple subsequent message with a `text` role, especially if names are involved.
69
+ - There can be multiple names attached to a message.
70
+ - 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.
71
+ </details>
72
+
73
+ 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.
74
+
75
+ Here's how you can prompt the model for the following tasks
76
+
77
+ ### Steerable Story-writing and Role-playing:
78
+
79
+ - [Story-writing prompt guide](https://dreamgen.com/docs/models/opus/v1#task-story-writing)
80
+ - [Role-playing prompt guide](https://dreamgen.com/docs/models/opus/v1#task-role-playing)
81
+ - Input:
82
+ - System prompt: You provide story / role-play description, which consists of:
83
+ - Plot description
84
+ - Style description
85
+ - Characters and their descriptions
86
+ - Conversation turns:
87
+ - Text / message turn: This represents part of the story or role play
88
+ - Instruction: This tells the model what should happen next
89
+ - Output: Continuation of the story / role-play.
90
+
91
+ ### Story plot summarization
92
+
93
+ - [Prompt guide](https://dreamgen.com/docs/models/opus/v1#task-plot-description)
94
+ - Input: A story, or a few chapters of a story.
95
+ - Output: A description of the story or chapters.
96
+
97
+ #### Examples:
98
+
99
+ <details>
100
+ <summary>Summary of <a href="https://www.libraryofshortstories.com/onlinereader/the-last-incantation">short fiction story</a> in 50 words</summary>
101
+ <blockquote>
102
+ Malygris, a powerful magician, summons his long-dead lover Nylissa from the grave using necromancy. However, upon seeing her, he realizes that she is not the same person he once knew, leading him to question the nature of love, memory, and the power of magic.
103
+ </blockquote>
104
+ </details>
105
+ <details>
106
+ <summary>Summary of <a href="https://www.libraryofshortstories.com/onlinereader/the-last-incantation">short fiction story</a> in 200 words</summary>
107
+ <blockquote>
108
+ The story is a dark fantasy set in the city of Susran, where an ancient and powerful magician named Malygris dwells in a tower atop a conical hill. Malygris, who has mastered all forms of sorcery and necromancy, is plagued by a deep sense of ennui and melancholy. He seeks solace in the memory of Nylissa, a girl he once loved in his youth.
109
+
110
+ One day, Malygris decides to summon Nylissa's spirit from the grave using his necromantic powers. He performs the necessary rituals and incantations, and Nylissa appears before him as a ghostly apparition. However, as Malygris gazes upon her, he becomes increasingly disillusioned. He notices subtle changes in her appearance and behavior that do not match his memories of her. He begins to question whether this is truly the same Nylissa he once knew, or if it is just another illusion conjured by his magic.
111
+
112
+ As Malygris grapples with this uncertainty, he becomes increasingly despondent and disillusioned with life itself. He realizes that even his magic cannot bring back the past or make him truly happy. In the end, he dismisses Nylissa's spirit and returns to his lonely tower, resigned to his fate as an old and weary sorcerer.
113
+ </blockquote>
114
+
115
+ </details>
116
+ <details>
117
+ <summary>Summary of <a href="https://edition.cnn.com/2024/02/29/health/pets-diseases-viruses-bacteria-wellness/index.html">CNN News article</a> in 150 words</summary>
118
+ <blockquote>
119
+ The article discusses the recent human deaths from diseases transmitted by animals, specifically Alaskapox and bubonic plague. Dr. Leana Wen, an emergency physician and former Baltimore health commissioner, explains the various ways household pets can transmit diseases to humans. These include fecal-oral transmission, scratches and bites, and vector-borne diseases like ticks, fleas, and mosquitoes. Wen emphasizes the importance of vaccinating pets, maintaining cleanliness, and taking commonsense precautions to reduce disease transmission. She also advises that individuals who are immunocompromised, babies, and pregnant women should take additional care when interacting with animals.
120
+ </blockquote>
121
+ </details>
122
+ <details>
123
+ <summary>Summary of <a href="https://edition.cnn.com/2024/02/29/health/pets-diseases-viruses-bacteria-wellness/index.html">CNN News article</a> in 50 words</summary>
124
+ <blockquote>
125
+ A doctor discusses the risks of diseases transmitted from animals to humans, focusing on household pets like cats and dogs. They emphasize the importance of vaccination, hygiene, and regular veterinary care to prevent these illnesses.
126
+ </blockquote>
127
+ </details>
128
+
129
+ ### Story character description
130
+
131
+ - [Prompt guide](https://dreamgen.com/docs/models/opus/v1#task-char-description)
132
+ - Input: A story, or a few chapters of a story, set of characters.
133
+ - Output: A description of the characters.
134
+
135
+ #### Examples:
136
+
137
+ <details>
138
+ <summary>Description of the Malygris character from <a href="https://www.libraryofshortstories.com/onlinereader/the-last-incantation">this story</a> in 50 words</summary>
139
+ <blockquote>
140
+ Malygris is an ancient and powerful magician, characterized by his long white beard, cold green eyes, and a violet robe. He is a master of necromancy and possesses a vast knowledge of forbidden magic. Despite his immense power, he is plagued by a deep sense of melancholy and ennui.
141
+ </blockquote>
142
+ </details>
143
+
144
+ <details>
145
+ <summary>Description of the prince character from <a href="https://www.libraryofshortstories.com/onlinereader/the-pearl-of-love">this story</a> in 50 words</summary>
146
+ <blockquote>
147
+ The prince is a devoted and determined individual, driven by his love for his late queen. He is described as a graceful youth in the beginning, but as he grows older, his dedication to the Pearl of Love transforms him into a grave and intent man. His sense of color and design evolves over time, reflecting his growing maturity and artistic vision.
148
+ </blockquote>
149
+ </details>
150
+
151
+ ### Story style description
152
+
153
+ - [Prompt guide](https://dreamgen.com/docs/models/opus/v1#task-style-description)
154
+ - Input: A story, or a few chapters of a story.
155
+ - Output: A description the style of the story.
156
+
157
+ <details>
158
+ <summary>Style description of <a href="https://www.libraryofshortstories.com/onlinereader/the-last-incantation">this story</a></summary>
159
+ <blockquote>
160
+ The story is written in a descriptive and evocative style, with a focus on the atmosphere and setting. The author uses vivid and detailed language to create a sense of place and time, and employs a variety of literary devices such as similes, metaphors, and allusions to enhance the mood and tone of the narrative. The sentence structure is varied, with a mix of short and long sentences that create a rhythmic flow to the prose.
161
+ </blockquote>
162
+ </details>
163
+
164
+ <details>
165
+ <summary>Style description of <a href="https://www.libraryofshortstories.com/onlinereader/the-pearl-of-love">this story</a></summary>
166
+ <blockquote>
167
+ The writing style is descriptive and evocative, with a focus on the beauty and grandeur of the Pearl of Love. The author uses vivid imagery and sensory details to create a rich and immersive atmosphere. The tone is reverential and contemplative, reflecting the prince's deep love for his queen and his dedication to creating a lasting monument to her memory.
168
+ </blockquote>
169
+ </details>
170
+
171
+ ### Story description to chapters
172
+
173
+ - [Prompt guide](https://dreamgen.com/docs/models/opus/v1#task-story-description-to-chapter-descriptions)
174
+ - Input: A brief plot description and the desired number of chapters.
175
+ - Output: A description for each chapter.
176
+
177
+ ### And more...
178
+
179
+ ## Sampling params
180
+
181
+ 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`.
182
+
183
+ You may also benefit from setting presence, frequency and repetition penalties, especially at lower temperatures.
184
+
185
+ ## Dataset
186
+
187
+ 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.
188
+
189
+ All story-writing and role-playing examples were based on human-written text.
190
+
191
+ ![token count distribution](images/token_count_cum__token_bucket.png)
192
+
193
+ ## Running the model
194
+
195
+ The model is should be compatible with any software that supports the base model, but beware of prompting and tokenization.
196
+
197
+ I recommend using these model versions:
198
+
199
+ - 7B: [no quant (opus-v1.2-7b)](https://huggingface.co/dreamgen/opus-v1.2-7b)
200
+ - 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)
201
+ - 34B: [no quant (opus-v1.2-70b)](https://huggingface.co/dreamgen/opus-v1.2-70b) or [awq (opus-v1.2-70b-awq)](https://huggingface.co/dreamgen/opus-v1.2-70b-awq)
202
+
203
+ ### Running on DreamGen.com (free)
204
+
205
+ You can run the models on [dreamgen.com](https://dreamgen.com) for free — you can use the built-in UI for story-writing & role-playing, or use [the API](https://dreamgen.com/docs/api).
206
+
207
+ ### Running Locally
208
+
209
+ - **Make sure your prompt is as close as possible to the Opus V1**
210
+ - Regardless of which backend you use, it's important that you format your prompt well and that the tokenization works correctly.
211
+ - [Read the prompt guide](https://dreamgen.com/docs/models/opus/v1)
212
+ - [Read the prompt formatting code](example/prompt/format.py)
213
+ - Make sure `<|im_start|>` and `<|im_end|>` are tokenized correctly
214
+ - **vLLM**
215
+ - [**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.
216
+ - [Code](example/prompt/interactive.py): This is simple script for interactive chat for one hard-coded scenario.
217
+ - **SillyTavern**
218
+ - [Official SillyTavern documentation for DreamGen](https://docs.sillytavern.app/usage/api-connections/dreamgen/) -- applies to both the API an local models
219
+ - SillyTavern (staging) comes with built-in DreamGen preset for RP
220
+ - Other presets can be found [here](https://huggingface.co/dreamgen/opus-v1.2-llama-3-8b/tree/main/configs/silly_tavern), v2 kindly provided by @MarinaraSpaghetti
221
+ - Make sure to unselect `Skip special tokens`, otherwise it won't work
222
+ - This is just an attempt at approximating the Opus V1 prompt, it won't be perfect
223
+ - Character cards specifically rewritten for the built-in DreamGen preset:
224
+ - [Seraphina](configs/silly_tavern/cards/Seraphina.png) (based on the default Seraphina card)
225
+ - [Lara Lightland](configs/silly_tavern/cards/LaraLightland.png) (based on the card by Deffcolony)
226
+ - **LM Studio**
227
+ - [Config](configs/lmstudio/preset.json)
228
+ - Just like ChatML, just changed "assistant" to "text" role.
229
+ - **There's a bug** in LM Studio if you delete a message or click "Continue", [see here for details](https://discord.com/channels/1110598183144399058/1212665261128417280/1212665261128417280).
230
+ - **HuggingFace**
231
+ - [Chat template](tokenizer_config.json#L51)
232
+ - Just like ChatML, just changed "assistant" to "text" role.
233
+
234
+ ## Known Issues
235
+
236
+ - **34B repetition**:
237
+ - The 34B sometimes gets stuck repeating the same word, or synonyms. This seems to be a common problem across various Yi 34B fine-tunes.
238
+ - **GGUF**:
239
+ - The tokenization might be messed up. Some users reported that `<|im_start|>` and `<|im_end|>` are tokenized as multiple tokens. Also llama.cpp may not tokenize correctly (the Yi tokenizer is subtly different from the Llama 2 tokenizer).
240
+
241
+ ## License
242
+
243
+ - This model is intended for personal use only, other use is not permitted.
opus-v1.2-llama-3-8b-Q3_K_L.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2d10dc42a86ff715a239b62afd188c3083faa1d54eed2fd63bb815ae1bc6e69
3
+ size 4322469120
opus-v1.2-llama-3-8b-Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8cb35faaa85f9508f8243053fbaafc3c1a32dba8161b578df81fba13d06f3ae3
3
+ size 4921246976
opus-v1.2-llama-3-8b-Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9a8038f566962e4747808422845fa1968c52f93c70f92d327fbb1c46de9711a
3
+ size 5733500160
opus-v1.2-llama-3-8b-Q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bb0bdaaa173c9f329cb5736818673f9d6f177df115d5d825842adcb9cf76fab2
3
+ size 6596519168
opus-v1.2-llama-3-8b-Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e27c90d3fbbacb315fd9e411968621a1096a66bc26ef03ee9e7a8c8a4999ed16
3
+ size 8541283584