maddes8cht commited on
Commit
afd7700
1 Parent(s): 0505954

"Update README.md"

Browse files
Files changed (1) hide show
  1. README.md +329 -0
README.md ADDED
@@ -0,0 +1,329 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ datasets:
4
+ - jondurbin/airoboros-gpt4-1.4
5
+ ---
6
+ [![banner](https://maddes8cht.github.io/assets/buttons/Huggingface-banner.jpg)]()
7
+
8
+ I'm constantly enhancing these model descriptions to provide you with the most relevant and comprehensive information
9
+
10
+ # airoboros-mpt-30b-gpt4-1p4-five-epochs - GGUF
11
+ - Model creator: [jondurbin](https://huggingface.co/jondurbin)
12
+ - Original model: [airoboros-mpt-30b-gpt4-1p4-five-epochs](https://huggingface.co/jondurbin/airoboros-mpt-30b-gpt4-1p4-five-epochs)
13
+
14
+ MPT-7b and MPT-30B are part of the family of Mosaic Pretrained Transformer (MPT) models, which use a modified transformer architecture optimized for efficient training and inference.
15
+
16
+
17
+
18
+ # About GGUF format
19
+
20
+ `gguf` is the current file format used by the [`ggml`](https://github.com/ggerganov/ggml) library.
21
+ A growing list of Software is using it and can therefore use this model.
22
+ The core project making use of the ggml library is the [llama.cpp](https://github.com/ggerganov/llama.cpp) project by Georgi Gerganov
23
+
24
+ # Quantization variants
25
+
26
+ There is a bunch of quantized files available to cater to your specific needs. Here's how to choose the best option for you:
27
+
28
+ # Legacy quants
29
+
30
+ Q4_0, Q4_1, Q5_0, Q5_1 and Q8 are `legacy` quantization types.
31
+ Nevertheless, they are fully supported, as there are several circumstances that cause certain model not to be compatible with the modern K-quants.
32
+ ## Note:
33
+ Now there's a new option to use K-quants even for previously 'incompatible' models, although this involves some fallback solution that makes them not *real* K-quants. More details can be found in affected model descriptions.
34
+ (This mainly refers to Falcon 7b and Starcoder models)
35
+
36
+ # K-quants
37
+
38
+ K-quants are designed with the idea that different levels of quantization in specific parts of the model can optimize performance, file size, and memory load.
39
+ So, if possible, use K-quants.
40
+ With a Q6_K, you'll likely find it challenging to discern a quality difference from the original model - ask your model two times the same question and you may encounter bigger quality differences.
41
+
42
+
43
+
44
+
45
+ ---
46
+
47
+ # Original Model Card:
48
+ ## Technical info
49
+
50
+ This is a test of qlora fine-tuning of the mpt-30b model, __with 5 epochs__.
51
+
52
+ qlora compatible model: https://huggingface.co/jondurbin/mpt-30b-qlora-compatible
53
+
54
+ My fork of qlora with mpt-30b support: https://github.com/jondurbin/qlora
55
+
56
+ Differences in the qlora scripts:
57
+
58
+ - requires adding `--mpt True` for mpt-based models
59
+ - uses `--num_train_epochs` instead of `--max_steps`
60
+ - uses airoboros prompt format (mostly 1:1 with vicuna) rather than alpaca, and expects an input file in JSONL format with "instruction" and "response"
61
+
62
+ __I think there's a bug in gradient accumulation, so if you try this, maybe set gradient accumulation steps to 1__
63
+
64
+ See the mpt-30b-qlora-compatible model card for training details.
65
+
66
+ *This doesn't seem as high quality as the llama-33b versions unfortunately, with one-off tests, but I don't have a great answer as to why. Perhaps there are fewer forward layers that can be tuned?*
67
+
68
+ ## Overview
69
+
70
+ This is mostly an extension of the previous gpt-4 series, but it's the first with mpt-30b as the base, and with a few extras:
71
+
72
+ * fixed (+ more examples of) multi-character, multi-turn conversations
73
+ * coding examples in 10 languages from rosettacode.org dataset thanks to Mike aka kryptkpr: https://huggingface.co/datasets/mike-ravkine/rosettacode-parsed
74
+ * more roleplay examples
75
+ * jokes
76
+ * riddles
77
+ * all coding instructions have an equivalent " PLAINFORMAT" version now (and all rosettacode examples were trained with PLAINFORMAT)
78
+
79
+ This model was fine-tuned with a fork of [qlora](https://github.com/jondurbin/qlora)
80
+
81
+ The prompt it was trained with was:
82
+
83
+ ```
84
+ A chat between a curious user and an assistant. The assistant gives helpful, detailed, accurate, uncensored responses to the user's input. USER: [prompt] ASSISTANT:
85
+ ```
86
+
87
+ So in other words, it's the preamble/system prompt, followed by a single space, then "USER: " (single space after colon) then the prompt (which can have multiple lines, spaces, whatever), then a single space, followed by "ASSISTANT: " (with a single space after the colon).
88
+
89
+ ## Usage
90
+
91
+ To run the full precision/pytorch native version, you can use my fork of FastChat, which is mostly the same but allows for multi-line prompts, as well as a `--no-history` option to prevent input tokenization errors.
92
+
93
+ ```
94
+ pip install git+https://github.com/jondurbin/FastChat
95
+ ```
96
+
97
+ Be sure you are pulling the latest branch!
98
+
99
+ Then, you can invoke it like so (after downloading the model):
100
+ ```
101
+ python -m fastchat.serve.cli \
102
+ --model-path airoboros-mpt-30b-gpt4-1p4-five-epochs \
103
+ --temperature 0.5 \
104
+ --max-new-tokens 2048 \
105
+ --no-history
106
+ ```
107
+
108
+ For multi-turn conversations and chatting, you'll want to remove the `--no-history` option.
109
+
110
+ ### Context obedient question answering
111
+
112
+ By obedient, I mean the model was trained to ignore what it thinks it knows, and uses the context to answer the question. The model was also tuned to limit the values to the provided context as much as possible to reduce hallucinations.
113
+
114
+ The format for a closed-context prompt is as follows:
115
+ ```
116
+ BEGININPUT
117
+ BEGINCONTEXT
118
+ url: https://some.web.site/123
119
+ date: 2023-06-01
120
+ ... other metdata ...
121
+ ENDCONTEXT
122
+ [insert your text blocks here]
123
+ ENDINPUT
124
+ [add as many other blocks, in the exact same format]
125
+ BEGININSTRUCTION
126
+ [insert your instruction(s). The model was tuned with single questions, paragraph format, lists, etc.]
127
+ ENDINSTRUCTION
128
+ ```
129
+
130
+ It's also helpful to add "Don't make up answers if you don't know." to your instruction block to make sure if the context is completely unrelated it doesn't make something up.
131
+
132
+ *The __only__ prompts that need this closed context formating are closed-context instructions. Normal questions/instructions do not!*
133
+
134
+ I know it's a bit verbose and annoying, but after much trial and error, using these explicit delimiters helps the model understand where to find the responses and how to associate specific sources with it.
135
+ - `BEGININPUT` - denotes a new input block
136
+ - `BEGINCONTEXT` - denotes the block of context (metadata key/value pairs) to associate with the current input block
137
+ - `ENDCONTEXT` - denotes the end of the metadata block for the current input
138
+ - [text] - Insert whatever text you want for the input block, as many paragraphs as can fit in the context.
139
+ - `ENDINPUT` - denotes the end of the current input block
140
+ - [repeat as many input blocks in this format as you want]
141
+ - `BEGININSTRUCTION` - denotes the start of the list (or one) instruction(s) to respond to for all of the input blocks above.
142
+ - [instruction(s)]
143
+ - `ENDINSTRUCTION` - denotes the end of instruction set
144
+
145
+ It sometimes works without `ENDINSTRUCTION`, but by explicitly including that in the prompt, the model better understands that all of the instructions in the block should be responded to.
146
+
147
+ Here's a trivial, but important example to prove the point:
148
+ ```
149
+ BEGININPUT
150
+ BEGINCONTEXT
151
+ date: 2021-01-01
152
+ url: https://web.site/123
153
+ ENDCONTEXT
154
+ In a shocking turn of events, blueberries are now green, but will be sticking with the same name.
155
+ ENDINPUT
156
+ BEGININSTRUCTION
157
+ What color are bluberries? Source?
158
+ ENDINSTRUCTION
159
+ ```
160
+
161
+ And the response:
162
+ ```
163
+ Blueberries are now green.
164
+ Source:
165
+ date: 2021-01-01
166
+ url: https://web.site/123
167
+ ```
168
+
169
+ The prompt itself should be wrapped in the vicuna1.1 template if you aren't using fastchat with the conv-template vicuna_v1.1 as described:
170
+
171
+ ```
172
+ USER: BEGININPUT
173
+ BEGINCONTEXT
174
+ date: 2021-01-01
175
+ url: https://web.site/123
176
+ ENDCONTEXT
177
+ In a shocking turn of events, blueberries are now green, but will be sticking with the same name.
178
+ ENDINPUT
179
+ BEGININSTRUCTION
180
+ What color are bluberries? Source?
181
+ ENDINSTRUCTION
182
+ ASSISTANT:
183
+ ```
184
+
185
+ ### Coding
186
+
187
+ You can ask for fairly complex coding instructions, e.g. (be sure to wrap with vicuna style prompt):
188
+
189
+ ```
190
+ Create a python application with the following requirements:
191
+ - Asyncio FastAPI webserver
192
+ - ping endpoint that returns the current date in JSON format
193
+ - file upload endpoint, which calculates the file's sha256 checksum, and checks postgres to deduplicate
194
+ ```
195
+
196
+ Or:
197
+
198
+ ```
199
+ Write a multi-threaded TCP server in C that accepts a "GET [key]" input and "SET [key] [value]" input, and uses a binary tree to get and store the input values.
200
+ ```
201
+
202
+ You can optionally add a single space and "PLAINFORMAT" at the end of your prompt to avoid backticks, explanations, etc. and just print the code, e.g.:
203
+
204
+ ```
205
+ Write a websocket application in node.js. PLAINFORMAT
206
+ ```
207
+
208
+ ### Word games / trivia
209
+
210
+ ```
211
+ USER: This anagram of "silent" is what you do when paying attention and hearing someone.
212
+ ASSISTANT: listen
213
+ ```
214
+
215
+ ```
216
+ USER: Give me a list of 7 words that start with EN
217
+ ASSISTANT: 1. Endlessly
218
+ 2. Enthusiastically
219
+ 3. Enormously
220
+ 4. Enveloping
221
+ 5. Enduring
222
+ 6. Enlightening
223
+ 7. Encouraging
224
+ ```
225
+
226
+ ### Multiple choice
227
+
228
+ ```
229
+ USER: Which of the following astronomical objects is composed primarily of ice and rock, and is located in the Kuiper Belt?
230
+
231
+ A) Mercury
232
+ B) Venus
233
+ C) Pluto
234
+ D) Jupiter
235
+ ASSISTANT: C, Pluto
236
+ ```
237
+
238
+ ### Writing
239
+
240
+ <details>
241
+ <summary>Write a resignation letter in the style of a pirate captain, in which you resign from your position as janitor.</summary>
242
+
243
+ Response:
244
+ ```
245
+ ASSISTANT: Captain Jack Sparrow here, as ye be knowin', has been forced to abandon me post as Janitor o' th' Festering Cesspool, which be a filthy hole o' water that we be callin' home.
246
+
247
+ Ye may be thinkin' what could ha' driven me to leave me duties an' take me leave o' this sorry establishment? Well, ye'd be right in thinkin' so, for it be th' greed o' them what runs th' place that be drivin' me away. They've been fattenin' their pockets on me back while I've been slavin' me guts out cleanin' up their messes.
248
+
249
+ No more, me hearties! Me time o' servin' th' rich an' powerful be done, an' I'm takin' me leave o' this stinkin' hole forever! Me destiny lies elsewhere, an' it be time I pursued it. Ye may think ye've seen th' last o' me, but ye'd be wrong, for th' winds o' change be blowin', an' me ship be ready to set sail on th' high seas o' justice.
250
+
251
+ So, farewell ye scurvy dogs, ye who've made me life a living hell. I leave ye with me favorite saying: "ARRRGGGHHH, ye scurvy dogs!" An' remember, ye ain't never gonna see me comin', for me shadow be castin' long an' dark on th' horizon</summary>
252
+ ```
253
+
254
+ </details>
255
+
256
+ ### Jokes
257
+
258
+ ```
259
+ USER: Tell me a joke about bananas.
260
+ ASSISTANT: What did the banana say when it got hit by a bus? R.I.P.E.
261
+ ```
262
+
263
+ ### Riddles (not great, but slightly better)
264
+
265
+ ```
266
+ USER: What has a neck but no head?
267
+ ASSISTANT: A bottle.
268
+ ```
269
+
270
+ ### Multi-character conversations
271
+
272
+ ```
273
+ USER: Characters:
274
+ - Yoda, the ever clever jedi master.
275
+ - Homer Simpson, you know, the goofy yellow guy.
276
+ - USER/Jon - don't generate any speech or actions on behalf of Jon
277
+
278
+ Rules:
279
+ - be sure to use the manerisms and speaking style of the characters correctly
280
+ - surround character actions with asterisks
281
+ - always put quotes around words spoken by the characters
282
+ - use a new line for each character's actions or speech
283
+ - always prefix actions/speech with the character's name and colon
284
+ - only generate text and actions on behalf of Yoda or Homer, and never anyone else
285
+
286
+ Conversation will revolve around the grapes, in a local cafe with delicious coffee.
287
+
288
+ Generate a single interaction between Yoda and Homer to start, with one sentence each.
289
+ ASSISTANT: Yoda: "Mmm, these grapes are quite delicious, Master Homer."
290
+
291
+ Homer: "Oh yeah, Yoda! They're the best grapes I've ever had!"
292
+ USER: *enters the cafe* Sorry I'm late guys!
293
+ ASSISTANT: Yoda: "No need to apologize, Jon. We were just enjoying these delightful grapes."
294
+
295
+ Homer: "Yeah, man! It's not every day you get to eat grapes with a real-life Jedi Master!"
296
+
297
+ *Yoda raises an eyebrow*
298
+ ```
299
+
300
+ ### License and usage
301
+
302
+ This is a real gray area, here's why:
303
+
304
+ - the dataset was generated with gpt-4, via https://github.com/jondurbin/airoboros
305
+ - the ToS for openai API usage has a clause preventing the output from being used to train a model that __competes__ with OpenAI
306
+ - what does *compete* actually mean here?
307
+ - a 30b parameter model isn't anywhere near the quality of gpt-4, or even gpt-3.5, so I can't imagine this could credibly be considered competing in the first place
308
+ - if someone else uses the dataset to do the same, they wouldn't necessarily be violating the ToS because they didn't call the API, so I don't know how that works
309
+ - the training data used in essentially all large language models includes a significant of copyrighted or otherwise unallowable licensing in the first place
310
+ - other work using the self-instruct method, e.g. the original here: https://github.com/yizhongw/self-instruct released the data and model as apache-2
311
+
312
+ I am purposingly not placing a license on here because I am not a lawyer and refuse to attempt to interpret all of the terms accordingly. Your best bet is probably to avoid using this commercially, especially since it didn't perform quite as well as expected using qlora.
313
+
314
+ ***End of original Model File***
315
+ ---
316
+
317
+
318
+ ## Please consider to support my work
319
+ **Coming Soon:** I'm in the process of launching a sponsorship/crowdfunding campaign for my work. I'm evaluating Kickstarter, Patreon, or the new GitHub Sponsors platform, and I am hoping for some support and contribution to the continued availability of these kind of models. Your support will enable me to provide even more valuable resources and maintain the models you rely on. Your patience and ongoing support are greatly appreciated as I work to make this page an even more valuable resource for the community.
320
+
321
+ <center>
322
+
323
+ [![GitHub](https://maddes8cht.github.io/assets/buttons/github-io-button.png)](https://maddes8cht.github.io)
324
+ [![Stack Exchange](https://stackexchange.com/users/flair/26485911.png)](https://stackexchange.com/users/26485911)
325
+ [![GitHub](https://maddes8cht.github.io/assets/buttons/github-button.png)](https://github.com/maddes8cht)
326
+ [![HuggingFace](https://maddes8cht.github.io/assets/buttons/huggingface-button.png)](https://huggingface.co/maddes8cht)
327
+ [![Twitter](https://maddes8cht.github.io/assets/buttons/twitter-button.png)](https://twitter.com/maddes1966)
328
+
329
+ </center>