GGUF
Composer
MosaicML
llm-foundry
maddes8cht commited on
Commit
c8edc8c
·
1 Parent(s): 8603143

"Update README.md"

Browse files
Files changed (1) hide show
  1. README.md +280 -0
README.md ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-sa-3.0
3
+ datasets:
4
+ - mosaicml/dolly_hhrlhf
5
+ tags:
6
+ - Composer
7
+ - MosaicML
8
+ - llm-foundry
9
+ inference: false
10
+ ---
11
+ [![banner](https://maddes8cht.github.io/assets/buttons/Huggingface-banner.jpg)]()
12
+
13
+ I'm constantly enhancing these model descriptions to provide you with the most relevant and comprehensive information
14
+
15
+ # mpt-7b-instruct - GGUF
16
+ - Model creator: [mosaicml](https://huggingface.co/mosaicml)
17
+ - Original model: [mpt-7b-instruct](https://huggingface.co/mosaicml/mpt-7b-instruct)
18
+
19
+ # Important Update for Falcon Models in llama.cpp Versions After October 18, 2023
20
+
21
+ 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.
22
+
23
+ **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.
24
+
25
+ **Key Points:**
26
+
27
+ - **Stay Informed:** Keep an eye on software application release schedules using llama.cpp libraries.
28
+ - **Monitor Upload Times:** Re-quantization is *almost* done. Watch for updates on my Hugging Face Model pages.
29
+
30
+ **Important Compatibility Note:** Old software will work with old Falcon models, but expect updated software to exclusively support the new models.
31
+
32
+ This change primarily affects **Falcon** and **Starcoder** models, with other models remaining unaffected.
33
+
34
+
35
+
36
+
37
+ # About GGUF format
38
+
39
+ `gguf` is the current file format used by the [`ggml`](https://github.com/ggerganov/ggml) library.
40
+ A growing list of Software is using it and can therefore use this model.
41
+ The core project making use of the ggml library is the [llama.cpp](https://github.com/ggerganov/llama.cpp) project by Georgi Gerganov
42
+
43
+ # Quantization variants
44
+
45
+ There is a bunch of quantized files available. How to choose the best for you:
46
+
47
+ # Legacy quants
48
+
49
+ Q4_0, Q4_1, Q5_0, Q5_1 and Q8 are `legacy` quantization types.
50
+ Nevertheless, they are fully supported, as there are several circumstances that cause certain model not to be compatible with the modern K-quants.
51
+ Falcon 7B models cannot be quantized to K-quants.
52
+
53
+ # K-quants
54
+
55
+ 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.
56
+ So, if possible, use K-quants.
57
+ 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.
58
+
59
+
60
+
61
+
62
+ ---
63
+
64
+ # Original Model Card:
65
+ # MPT-7B-Instruct
66
+
67
+ MPT-7B-Instruct is a model for short-form instruction following.
68
+ It is built by finetuning [MPT-7B](https://huggingface.co/mosaicml/mpt-7b) on a [dataset](https://huggingface.co/datasets/sam-mosaic/dolly_hhrlhf) derived from the [Databricks Dolly-15k](https://huggingface.co/datasets/databricks/databricks-dolly-15k) and the [Anthropic Helpful and Harmless (HH-RLHF)](https://huggingface.co/datasets/Anthropic/hh-rlhf) datasets.
69
+ * License: _CC-By-SA-3.0_
70
+ * [Demo on Hugging Face Spaces](https://huggingface.co/spaces/mosaicml/mpt-7b-instruct)
71
+
72
+
73
+ This model was trained by [MosaicML](https://www.mosaicml.com) and follows a modified decoder-only transformer architecture.
74
+
75
+ ## Model Date
76
+
77
+ May 5, 2023
78
+
79
+ ## Model License
80
+
81
+ CC-By-SA-3.0
82
+
83
+ ## Documentation
84
+
85
+ * [Blog post: Introducing MPT-7B: A New Standard for Open-Source, Commercially Usable LLMs](https://www.mosaicml.com/blog/mpt-7b)
86
+ * [Codebase (mosaicml/llm-foundry repo)](https://github.com/mosaicml/llm-foundry/)
87
+ * Questions: Feel free to contact us via the [MosaicML Community Slack](https://mosaicml.me/slack)!
88
+
89
+ ### Example Question/Instruction
90
+
91
+ **Longboi24**:
92
+ > What is a quoll?
93
+
94
+ **MPT-7B-Instruct**:
95
+
96
+ >A Quoll (pronounced “cool”) is one of Australia’s native carnivorous marsupial mammals, which are also known as macropods or wallabies in other parts around Asia and South America
97
+
98
+ ## How to Use
99
+
100
+ Note: This model requires that `trust_remote_code=True` be passed to the `from_pretrained` method. This is because we use a custom model architecture that is not yet part of the `transformers` package.
101
+
102
+ It includes options for many training efficiency features such as [FlashAttention (Dao et al. 2022)](https://arxiv.org/pdf/2205.14135.pdf), [ALiBi](https://arxiv.org/abs/2108.12409), QK LayerNorm, and more.
103
+
104
+ ```python
105
+ import transformers
106
+ model = transformers.AutoModelForCausalLM.from_pretrained(
107
+ 'mosaicml/mpt-7b-instruct',
108
+ trust_remote_code=True
109
+ )
110
+ ```
111
+ Note: This model requires that `trust_remote_code=True` be passed to the `from_pretrained` method.
112
+ This is because we use a custom `MPT` model architecture that is not yet part of the Hugging Face `transformers` package.
113
+ `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.
114
+
115
+ 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:
116
+ ```python
117
+ import torch
118
+ import transformers
119
+
120
+ name = 'mosaicml/mpt-7b-instruct'
121
+
122
+ config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
123
+ config.attn_config['attn_impl'] = 'triton'
124
+ config.init_device = 'cuda:0' # For fast initialization directly on GPU!
125
+
126
+ model = transformers.AutoModelForCausalLM.from_pretrained(
127
+ name,
128
+ config=config,
129
+ torch_dtype=torch.bfloat16, # Load model weights in bfloat16
130
+ trust_remote_code=True
131
+ )
132
+ ```
133
+
134
+ Although the model was trained with a sequence length of 2048, ALiBi enables users to increase the maximum sequence length during finetuning and/or inference. For example:
135
+
136
+ ```python
137
+ import transformers
138
+
139
+ name = 'mosaicml/mpt-7b-instruct'
140
+
141
+ config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
142
+ config.max_seq_len = 4096 # (input + output) tokens can now be up to 4096
143
+
144
+ model = transformers.AutoModelForCausalLM.from_pretrained(
145
+ name,
146
+ config=config,
147
+ trust_remote_code=True
148
+ )
149
+ ```
150
+
151
+ This model was trained with the [EleutherAI/gpt-neox-20b](https://huggingface.co/EleutherAI/gpt-neox-20b) tokenizer.
152
+
153
+ ```python
154
+ from transformers import AutoTokenizer
155
+ tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neox-20b")
156
+ ```
157
+
158
+ The model can then be used, for example, within a text-generation pipeline.
159
+ 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).
160
+
161
+ ```python
162
+ from transformers import pipeline
163
+
164
+ pipe = pipeline('text-generation', model=model, tokenizer=tokenizer, device='cuda:0')
165
+
166
+ with torch.autocast('cuda', dtype=torch.bfloat16):
167
+ print(
168
+ pipe('Here is a recipe for vegan banana bread:\n',
169
+ max_new_tokens=100,
170
+ do_sample=True,
171
+ use_cache=True))
172
+ ```
173
+
174
+ ### Formatting
175
+
176
+ This model was trained on data formatted in the dolly-15k format:
177
+
178
+ ```python
179
+ INSTRUCTION_KEY = "### Instruction:"
180
+ RESPONSE_KEY = "### Response:"
181
+ INTRO_BLURB = "Below is an instruction that describes a task. Write a response that appropriately completes the request."
182
+ PROMPT_FOR_GENERATION_FORMAT = """{intro}
183
+ {instruction_key}
184
+ {instruction}
185
+ {response_key}
186
+ """.format(
187
+ intro=INTRO_BLURB,
188
+ instruction_key=INSTRUCTION_KEY,
189
+ instruction="{instruction}",
190
+ response_key=RESPONSE_KEY,
191
+ )
192
+
193
+ example = "James decides to run 3 sprints 3 times a week. He runs 60 meters each sprint. How many total meters does he run a week? Explain before answering."
194
+ fmt_ex = PROMPT_FOR_GENERATION_FORMAT.format(instruction=example)
195
+ ```
196
+
197
+ In the above example, `fmt_ex` is ready to be tokenized and sent through the model.
198
+
199
+ ## Model Description
200
+
201
+ The architecture is a modification of a standard decoder-only transformer.
202
+
203
+ The model has been modified from a standard transformer in the following ways:
204
+ * It uses [FlashAttention](https://arxiv.org/pdf/2205.14135.pdf)
205
+ * It uses [ALiBi (Attention with Linear Biases)](https://arxiv.org/abs/2108.12409) and does not use positional embeddings
206
+ * It does not use biases
207
+
208
+
209
+ | Hyperparameter | Value |
210
+ |----------------|-------|
211
+ |n_parameters | 6.7B |
212
+ |n_layers | 32 |
213
+ | n_heads | 32 |
214
+ | d_model | 4096 |
215
+ | vocab size | 50432 |
216
+ | sequence length | 2048 |
217
+
218
+ ## PreTraining Data
219
+
220
+ For more details on the pretraining process, see [MPT-7B](https://huggingface.co/mosaicml/mpt-7b).
221
+
222
+ The data was tokenized using the [EleutherAI/gpt-neox-20b](https://huggingface.co/EleutherAI/gpt-neox-20b) tokenizer.
223
+
224
+ ### Training Configuration
225
+
226
+ This model was trained on 8 A100-40GBs for about 2.3 hours using the [MosaicML Platform](https://www.mosaicml.com/platform).
227
+ The model was trained with sharded data parallelism using [FSDP](https://pytorch.org/docs/stable/fsdp.html) and used the AdamW optimizer.
228
+
229
+ ## Limitations and Biases
230
+
231
+ _The following language is modified from [EleutherAI's GPT-NeoX-20B](https://huggingface.co/EleutherAI/gpt-neox-20b)_
232
+
233
+ MPT-7B-Instruct can produce factually incorrect output, and should not be relied on to produce factually accurate information.
234
+ MPT-7B-Instruct was trained on various public datasets.
235
+ 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.
236
+
237
+
238
+ ## Acknowledgements
239
+
240
+ This model was finetuned by Sam Havens and the MosaicML NLP team
241
+
242
+ ## MosaicML Platform
243
+
244
+ 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).
245
+
246
+ ## Disclaimer
247
+
248
+ 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 cosult an attorney before using this model for commercial purposes.
249
+
250
+ ## Citation
251
+
252
+ Please cite this model using the following format:
253
+
254
+ ```
255
+ @online{MosaicML2023Introducing,
256
+ author = {MosaicML NLP Team},
257
+ title = {Introducing MPT-7B: A New Standard for Open-Source, Commercially Usable LLMs},
258
+ year = {2023},
259
+ url = {www.mosaicml.com/blog/mpt-7b},
260
+ note = {Accessed: 2023-03-28}, % change this date
261
+ urldate = {2023-03-28} % change this date
262
+ }
263
+ ```
264
+
265
+ ***End of original Model File***
266
+ ---
267
+
268
+
269
+ ## Please consider to support my work
270
+ **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.
271
+
272
+ <center>
273
+
274
+ [![GitHub](https://maddes8cht.github.io/assets/buttons/github-io-button.png)](https://maddes8cht.github.io)
275
+ [![Stack Exchange](https://stackexchange.com/users/flair/26485911.png)](https://stackexchange.com/users/26485911)
276
+ [![GitHub](https://maddes8cht.github.io/assets/buttons/github-button.png)](https://github.com/maddes8cht)
277
+ [![HuggingFace](https://maddes8cht.github.io/assets/buttons/huggingface-button.png)](https://huggingface.co/maddes8cht)
278
+ [![Twitter](https://maddes8cht.github.io/assets/buttons/twitter-button.png)](https://twitter.com/maddes1966)
279
+
280
+ </center>