GGUF
Composer
MosaicML
llm-foundry
maddes8cht commited on
Commit
5061fae
1 Parent(s): f215d94

"Update README.md"

Browse files
Files changed (1) hide show
  1. README.md +304 -0
README.md ADDED
@@ -0,0 +1,304 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-sa-4.0
3
+ datasets:
4
+ - camel-ai/code
5
+ - ehartford/wizard_vicuna_70k_unfiltered
6
+ - anon8231489123/ShareGPT_Vicuna_unfiltered
7
+ - teknium1/GPTeacher/roleplay-instruct-v2-final
8
+ - teknium1/GPTeacher/codegen-isntruct
9
+ - timdettmers/openassistant-guanaco
10
+ - camel-ai/math
11
+ - project-baize/baize-chatbot/medical_chat_data
12
+ - project-baize/baize-chatbot/quora_chat_data
13
+ - project-baize/baize-chatbot/stackoverflow_chat_data
14
+ - camel-ai/biology
15
+ - camel-ai/chemistry
16
+ - camel-ai/ai_society
17
+ - jondurbin/airoboros-gpt4-1.2
18
+ - LongConversations
19
+ - camel-ai/physics
20
+ tags:
21
+ - Composer
22
+ - MosaicML
23
+ - llm-foundry
24
+ inference: false
25
+ ---
26
+ [![banner](https://maddes8cht.github.io/assets/buttons/Huggingface-banner.jpg)]()
27
+
28
+ I'm constantly enhancing these model descriptions to provide you with the most relevant and comprehensive information
29
+
30
+ # mpt-30b-chat - GGUF
31
+ - Model creator: [mosaicml](https://huggingface.co/mosaicml)
32
+ - Original model: [mpt-30b-chat](https://huggingface.co/mosaicml/mpt-30b-chat)
33
+
34
+ # Important Update for Falcon Models in llama.cpp Versions After October 18, 2023
35
+
36
+ As noted on the [Llama.cpp GitHub repository](https://github.com/ggerganov/llama.cpp#hot-topics), all new Llama.cpp releases after October 18, 2023, will require a re-quantization due to the new BPE tokenizer.
37
+
38
+ **Good news!** I am glad that my re-quantization process for Falcon Models is nearly complete. Download the latest quantized models to ensure compatibility with recent llama.cpp software.
39
+
40
+ **Key Points:**
41
+
42
+ - **Stay Informed:** Keep an eye on software application release schedules using llama.cpp libraries.
43
+ - **Monitor Upload Times:** Re-quantization is *almost* done. Watch for updates on my Hugging Face Model pages.
44
+
45
+ **Important Compatibility Note:** Old software will work with old Falcon models, but expect updated software to exclusively support the new models.
46
+
47
+ This change primarily affects **Falcon** and **Starcoder** models, with other models remaining unaffected.
48
+
49
+
50
+
51
+
52
+ # About GGUF format
53
+
54
+ `gguf` is the current file format used by the [`ggml`](https://github.com/ggerganov/ggml) library.
55
+ A growing list of Software is using it and can therefore use this model.
56
+ The core project making use of the ggml library is the [llama.cpp](https://github.com/ggerganov/llama.cpp) project by Georgi Gerganov
57
+
58
+ # Quantization variants
59
+
60
+ There is a bunch of quantized files available. How to choose the best for you:
61
+
62
+ # Legacy quants
63
+
64
+ Q4_0, Q4_1, Q5_0, Q5_1 and Q8 are `legacy` quantization types.
65
+ Nevertheless, they are fully supported, as there are several circumstances that cause certain model not to be compatible with the modern K-quants.
66
+ Falcon 7B models cannot be quantized to K-quants.
67
+
68
+ # K-quants
69
+
70
+ K-quants are based on the idea that the quantization of certain parts affects the quality in different ways. If you quantize certain parts more and others less, you get a more powerful model with the same file size, or a smaller file size and lower memory load with comparable performance.
71
+ So, if possible, use K-quants.
72
+ With a Q6_K you should find it really hard to find a quality difference to the original model - ask your model two times the same question and you may encounter bigger quality differences.
73
+
74
+
75
+
76
+
77
+ ---
78
+
79
+ # Original Model Card:
80
+ # MPT-30B-Chat
81
+
82
+ MPT-30B-Chat is a chatbot-like model for dialogue generation.
83
+ It was built by finetuning [MPT-30B](https://huggingface.co/mosaicml/mpt-30b) on the [ShareGPT-Vicuna](https://huggingface.co/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered), [Camel-AI](https://huggingface.co/camel-ai),
84
+ [GPTeacher](https://github.com/teknium1/GPTeacher), [Guanaco](https://huggingface.co/datasets/timdettmers/openassistant-guanaco), [Baize](https://github.com/project-baize/baize-chatbot) and some generated datasets.
85
+ * License: _CC-By-NC-SA-4.0_ (non-commercial use only)
86
+
87
+
88
+ This model was trained by [MosaicML](https://www.mosaicml.com) and follows a modified decoder-only transformer architecture.
89
+
90
+ ## Model Date
91
+
92
+ June 22, 2023
93
+
94
+ ## Model License
95
+
96
+ _CC-By-NC-SA-4.0_ (non-commercial use only)
97
+
98
+ ## Documentation
99
+
100
+ * [Blog post: Raising the bar for open-source foundation models](https://www.mosaicml.com/blog/mpt-30b)
101
+ * [Codebase (mosaicml/llm-foundry repo)](https://github.com/mosaicml/llm-foundry/)
102
+ * Questions: Feel free to contact us via the [MosaicML Community Slack](https://mosaicml.me/slack)!
103
+
104
+ ### Example Dialogue
105
+
106
+ **ksreenivasan**:
107
+ > I want you to come up with a tweet based on this summary of the article:
108
+ >
109
+ > We are excited to extend the MosaicML Foundation Series with MPT-30B, a new commercially licensed open-source model that is significantly more powerful, and outperforms the
110
+ > original GPT-3. In addition, we are releasing two fine-tuned models, MPT-30B-Instruct and MPT-30B-Chat, that are built on top of MPT-30B and excel at short-form instruction
111
+ > following and multi-turn conversations, respectively.
112
+ > All MPT-30B models come with special features that differentiate them from other LLMs, including an 8k token context window (which can be further extended via finetuning;
113
+ > see MPT-7B-StoryWriter), support for context-length extrapolation via ALiBi, and efficient inference + training performance via FlashAttention. It also has strong coding
114
+ > abilities thanks to its pretraining data mixture.
115
+
116
+
117
+
118
+ **MPT-30B-Chat**:
119
+ > "Revolutionize your AI capabilities with MosaicML's latest addition, MPT-30B! Outperforming GPT-3, this open-source model is significantly more powerful and comes with
120
+ > finely-tuned models for exceptional instruction following and multi-turn conversations. Unleash the potential of an 8k token context window, ALiBi support, and FlashAttention.
121
+ > Experience the future of AI with MosaicML! #AI #ML #innovation"
122
+
123
+ **ksreenivasan**:
124
+ > Is there anything you want to say to MosaicML about this exciting news?
125
+
126
+ **MPT-30B-Chat**:
127
+ > As your AI marketing assistant, I would say that this is truly exciting news for the AI community! MosaicML's latest addition, MPT-30B, is poised to revolutionize the industry with its powerful open-source capabilities and finely-tuned models for instruction following and multi-turn conversations.
128
+ > The special features, including the 8k token context window, ALiBi support, and FlashAttention, are sure to set MosaicML's MPT-30B apart from other LLMs.
129
+ > Congratulations to the MosaicML team on this incredible achievement!
130
+
131
+ ## How to Use
132
+
133
+ This model is best used with the MosaicML [llm-foundry repository](https://github.com/mosaicml/llm-foundry) for training and finetuning.
134
+
135
+ ```python
136
+ import transformers
137
+ model = transformers.AutoModelForCausalLM.from_pretrained(
138
+ 'mosaicml/mpt-30b-chat',
139
+ trust_remote_code=True
140
+ )
141
+ ```
142
+ Note: This model requires that `trust_remote_code=True` be passed to the `from_pretrained` method.
143
+ This is because we use a custom `MPT` model architecture that is not yet part of the Hugging Face `transformers` package.
144
+ `MPT` includes options for many training efficiency features such as [FlashAttention](https://arxiv.org/pdf/2205.14135.pdf), [ALiBi](https://arxiv.org/abs/2108.12409), [QK LayerNorm](https://arxiv.org/abs/2010.04245), and more.
145
+
146
+ To use the optimized [triton implementation](https://github.com/openai/triton) of FlashAttention, you can load the model on GPU (`cuda:0`) with `attn_impl='triton'` and with `bfloat16` precision:
147
+ ```python
148
+ import torch
149
+ import transformers
150
+
151
+ name = 'mosaicml/mpt-30b-chat'
152
+
153
+ config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
154
+ config.attn_config['attn_impl'] = 'triton' # change this to use triton-based FlashAttention
155
+ config.init_device = 'cuda:0' # For fast initialization directly on GPU!
156
+
157
+ model = transformers.AutoModelForCausalLM.from_pretrained(
158
+ name,
159
+ config=config,
160
+ torch_dtype=torch.bfloat16, # Load model weights in bfloat16
161
+ trust_remote_code=True
162
+ )
163
+ ```
164
+
165
+ The model was trained initially with a sequence length of 2048 with an additional pretraining stage for sequence length adapation up to 8192. However, ALiBi enables users to increase the maximum sequence length even further during finetuning and/or inference. For example:
166
+
167
+ ```python
168
+ import transformers
169
+
170
+ name = 'mosaicml/mpt-30b-chat'
171
+
172
+ config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
173
+ config.max_seq_len = 16384 # (input + output) tokens can now be up to 16384
174
+
175
+ model = transformers.AutoModelForCausalLM.from_pretrained(
176
+ name,
177
+ config=config,
178
+ trust_remote_code=True
179
+ )
180
+ ```
181
+
182
+ This model was trained with the MPT-30B tokenizer which is based on the [EleutherAI/gpt-neox-20b](https://huggingface.co/EleutherAI/gpt-neox-20b) tokenizer and includes additional padding and eos tokens.
183
+
184
+ ```python
185
+ from transformers import AutoTokenizer
186
+ tokenizer = AutoTokenizer.from_pretrained('mosaicml/mpt-30b')
187
+ ```
188
+
189
+ The model can then be used, for example, within a text-generation pipeline.
190
+ Note: when running Torch modules in lower precision, it is best practice to use the [torch.autocast context manager](https://pytorch.org/docs/stable/amp.html).
191
+
192
+ ```python
193
+ from transformers import pipeline
194
+
195
+ with torch.autocast('cuda', dtype=torch.bfloat16):
196
+ inputs = tokenizer('Here is a recipe for vegan banana bread:\n', return_tensors="pt").to('cuda')
197
+ outputs = model.generate(**inputs, max_new_tokens=100)
198
+ print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
199
+
200
+ # or using the HF pipeline
201
+ pipe = pipeline('text-generation', model=model, tokenizer=tokenizer, device='cuda:0')
202
+ with torch.autocast('cuda', dtype=torch.bfloat16):
203
+ print(
204
+ pipe('Here is a recipe for vegan banana bread:\n',
205
+ max_new_tokens=100,
206
+ do_sample=True,
207
+ use_cache=True))
208
+ ```
209
+
210
+ ## Model Description
211
+
212
+ The architecture is a modification of a standard decoder-only transformer.
213
+
214
+ The model has been modified from a standard transformer in the following ways:
215
+ * It uses [FlashAttention](https://arxiv.org/pdf/2205.14135.pdf)
216
+ * It uses [ALiBi (Attention with Linear Biases)](https://arxiv.org/abs/2108.12409) and does not use positional embeddings
217
+ * It does not use biases
218
+
219
+
220
+ | Hyperparameter | Value |
221
+ |----------------|-------|
222
+ |n_parameters | 29.95B |
223
+ |n_layers | 48 |
224
+ | n_heads | 64 |
225
+ | d_model | 7168 |
226
+ | vocab size | 50432 |
227
+ | sequence length | 8192 |
228
+
229
+ ## Data Mix
230
+
231
+ The model was trained on the following data mix:
232
+
233
+ | Data Source | Number of Tokens in Source | Proportion |
234
+ |-------------|----------------------------|------------|
235
+ | Airoboros/GPT4-1.2 | 26.4M | 1.71% |
236
+ | Baize | 55.0M | 3.57% |
237
+ | Camel | 301M | 19.54% |
238
+ | GPTeacher | 7.56M | 0.49% |
239
+ | Guanaco | 15.6M | 1.02% |
240
+ | LongCoversations | 18.4M | 1.19% |
241
+ | ShareGPT | 821M | 53.24% |
242
+ | WizardLM | 297M | 19.23% |
243
+
244
+ "LongConversations" is a GPT3.5/4-generated dataset, details of which will be released at a later date.
245
+
246
+ ### Training Configuration
247
+
248
+ This model was trained on 64 H100s for about 7.6 hours using the [MosaicML Platform](https://www.mosaicml.com/platform).
249
+ The model was trained with sharded data parallelism using [FSDP](https://pytorch.org/docs/stable/fsdp.html) and used the AdamW optimizer.
250
+
251
+ ## Limitations and Biases
252
+
253
+ _The following language is modified from [EleutherAI's GPT-NeoX-20B](https://huggingface.co/EleutherAI/gpt-neox-20b)_
254
+
255
+ MPT-30B-Chat can produce factually incorrect output, and should not be relied on to produce factually accurate information.
256
+ MPT-30B-Chat was trained on various public datasets.
257
+ While great efforts have been taken to clean the pretraining data, it is possible that this model could generate lewd, biased or otherwise offensive outputs.
258
+
259
+ ## Acknowledgements
260
+
261
+ This model was finetuned by Sam Havens and the MosaicML NLP team
262
+
263
+ ## Disclaimer
264
+
265
+ The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.
266
+
267
+
268
+ ## MosaicML Platform
269
+
270
+ If you're interested in [training](https://www.mosaicml.com/training) and [deploying](https://www.mosaicml.com/inference) your own MPT or LLMs on the MosaicML Platform, [sign up here](https://forms.mosaicml.com/demo?utm_source=huggingface&utm_medium=referral&utm_campaign=mpt-7b).
271
+
272
+
273
+ ## Citation
274
+
275
+ Please cite this model using the following format:
276
+
277
+ ```
278
+ @online{MosaicML2023Introducing,
279
+ author = {MosaicML NLP Team},
280
+ title = {Introducing MPT-30B: Raising the bar
281
+ for open-source foundation models},
282
+ year = {2023},
283
+ url = {www.mosaicml.com/blog/mpt-30b},
284
+ note = {Accessed: 2023-06-22},
285
+ urldate = {2023-06-22}
286
+ }
287
+ ```
288
+
289
+ ***End of original Model File***
290
+ ---
291
+
292
+
293
+ ## Please consider to support my work
294
+ **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.
295
+
296
+ <center>
297
+
298
+ [![GitHub](https://maddes8cht.github.io/assets/buttons/github-io-button.png)](https://maddes8cht.github.io)
299
+ [![Stack Exchange](https://stackexchange.com/users/flair/26485911.png)](https://stackexchange.com/users/26485911)
300
+ [![GitHub](https://maddes8cht.github.io/assets/buttons/github-button.png)](https://github.com/maddes8cht)
301
+ [![HuggingFace](https://maddes8cht.github.io/assets/buttons/huggingface-button.png)](https://huggingface.co/maddes8cht)
302
+ [![Twitter](https://maddes8cht.github.io/assets/buttons/twitter-button.png)](https://twitter.com/maddes1966)
303
+
304
+ </center>