Upload folder using huggingface_hub

#1
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +241 -0
  3. mpt-30b-instruct-Q4_0.gguf +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* 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
 
 
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
36
+ mpt-30b-instruct-Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,244 @@
1
  ---
2
  license: cc-by-sa-3.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: cc-by-sa-3.0
3
+ datasets:
4
+ - competition_math
5
+ - conceptofmind/cot_submix_original/cot_gsm8k
6
+ - knkarthick/dialogsum
7
+ - mosaicml/dolly_hhrlhf
8
+ - duorc
9
+ - tau/scrolls/qasper
10
+ - emozilla/quality
11
+ - scrolls/summ_screen_fd
12
+ - spider
13
+ tags:
14
+ - Composer
15
+ - MosaicML
16
+ - llm-foundry
17
+ inference: false
18
  ---
19
+
20
+ # MPT-30B-Instruct
21
+ <span style="color:red">This is not working yet with the official version of llama.cpp</span>
22
+
23
+ This is the GGUF version of MPT-30B-Instruct based on [jploski's fork of llama.cpp](https://github.com/jploski/llama.cpp)
24
+
25
+ Right now it only works with that branch, but hopefully, this will be integrated with the official [llama.cpp](https://github.com/ggerganov/llama.cpp)
26
+
27
+ I needed this for some prototyping so I'll also maintain a fork of the python bindings while this isn't all merged in here: [llama-cpp-python-mpt](https://github.com/filipe-m-almeida/llama-cpp-python-mpt)
28
+
29
+ -----
30
+
31
+ MPT-30B-Instruct is a model for short-form instruction following.
32
+ It is built by finetuning [MPT-30B](https://huggingface.co/mosaicml/mpt-30b) on [Dolly HHRLHF](https://huggingface.co/datasets/mosaicml/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. It is also trained on [Competition Math](https://huggingface.co/datasets/competition_math), [Duorc](https://huggingface.co/datasets/duorc), [CoT GSM8k](https://huggingface.co/datasets/conceptofmind/cot_submix_original), [Qasper](https://huggingface.co/datasets/allenai/qasper), [Quality](https://huggingface.co/datasets/emozilla/quality), [Summ Screen FD](https://huggingface.co/datasets/tau/scrolls) and [Spider](https://huggingface.co/datasets/spider).
33
+ * License: _CC-By-SA-3.0_
34
+
35
+
36
+ This model was trained by [MosaicML](https://www.mosaicml.com) and follows a modified decoder-only transformer architecture.
37
+
38
+ ## Model Date
39
+
40
+ June 22, 2023
41
+
42
+ ## Model License
43
+
44
+ CC-By-SA-3.0
45
+
46
+ ## Documentation
47
+
48
+ * [Blog post: Raising the bar for open-source foundation models](https://www.mosaicml.com/blog/mpt-30b)
49
+ * [Codebase (mosaicml/llm-foundry repo)](https://github.com/mosaicml/llm-foundry/)
50
+ * Questions: Feel free to contact us via the [MosaicML Community Slack](https://mosaicml.me/slack)!
51
+
52
+ ### Example Question/Instruction
53
+
54
+ **Bespokenizer46**
55
+ > I need to convince my friend, Phyllis, that she should train a custom LLM for her Fortune 500 company using the MosaicML Platform.
56
+ > Please write an email that explains why MosaicML's emphasis on cutting edge methodology, data privacy, and efficiency are so important.
57
+ > End the email with a friendly inquiry about Phyllis's family.
58
+
59
+ **MPT-30B-Instruct**:
60
+ > Phyllis -
61
+ > I know you're always looking for ways to improve efficiency at work and I think I've found a solution that you'll be very interested in.
62
+ > LLMs are only as good as the data they're trained on and the training process can be very time consuming and resource intensive. MosaicML uses cutting edge methodology to efficiently train high quality models without compromising data privacy.
63
+ > They also provide tools to easily connect to and use the model in your daily workflow.
64
+ > I think you'd really enjoy speaking with their founder, we can set up a call if you're interested.
65
+ > Also, I know it's been a tough year for your family, how are things?
66
+
67
+ > Best,
68
+ > Your Friend
69
+
70
+ ## How to Use
71
+
72
+ 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.
73
+
74
+ 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.
75
+
76
+ ```python
77
+ import transformers
78
+ model = transformers.AutoModelForCausalLM.from_pretrained(
79
+ 'mosaicml/mpt-30b-instruct',
80
+ trust_remote_code=True
81
+ )
82
+ ```
83
+
84
+ 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:
85
+ ```python
86
+ import torch
87
+ import transformers
88
+
89
+ name = 'mosaicml/mpt-30b-instruct'
90
+
91
+ config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
92
+ config.attn_config['attn_impl'] = 'triton' # change this to use triton-based FlashAttention
93
+ config.init_device = 'cuda:0' # For fast initialization directly on GPU!
94
+
95
+ model = transformers.AutoModelForCausalLM.from_pretrained(
96
+ name,
97
+ config=config,
98
+ torch_dtype=torch.bfloat16, # Load model weights in bfloat16
99
+ trust_remote_code=True
100
+ )
101
+ ```
102
+
103
+ The model was trained initially on a sequence length of 2048. An additional pre-training phase was included for sequence length adaptation to 8192. However, ALiBi further enables users to increase the maximum sequence length during finetuning and/or inference. For example:
104
+
105
+ ```python
106
+ import transformers
107
+
108
+ name = 'mosaicml/mpt-30b-instruct'
109
+
110
+ config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
111
+ config.max_seq_len = 16384 # (input + output) tokens can now be up to 16384
112
+
113
+ model = transformers.AutoModelForCausalLM.from_pretrained(
114
+ name,
115
+ config=config,
116
+ trust_remote_code=True
117
+ )
118
+ ```
119
+
120
+ 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.
121
+
122
+ ```python
123
+ from transformers import AutoTokenizer
124
+ tokenizer = AutoTokenizer.from_pretrained('mosaicml/mpt-30b')
125
+ ```
126
+
127
+ The model can then be used, for example, within a text-generation pipeline.
128
+ 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).
129
+
130
+ ```python
131
+ from transformers import pipeline
132
+
133
+ with torch.autocast('cuda', dtype=torch.bfloat16):
134
+ inputs = tokenizer('Here is a recipe for vegan banana bread:\n', return_tensors="pt").to('cuda')
135
+ outputs = model.generate(**inputs, max_new_tokens=100)
136
+ print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
137
+
138
+ # or using the HF pipeline
139
+ pipe = pipeline('text-generation', model=model, tokenizer=tokenizer, device='cuda:0')
140
+ with torch.autocast('cuda', dtype=torch.bfloat16):
141
+ print(
142
+ pipe('Here is a recipe for vegan banana bread:\n',
143
+ max_new_tokens=100,
144
+ do_sample=True,
145
+ use_cache=True))
146
+ ```
147
+
148
+ ### Formatting
149
+
150
+ This model was trained on data formatted as follows:
151
+
152
+ ```python
153
+ def format_prompt(instruction):
154
+ template = "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n###Instruction\n{instruction}\n\n### Response\n"
155
+ return template.format(instruction=instruction)
156
+
157
+ example = "Tell me a funny joke.\nDon't make it too funny though."
158
+ fmt_ex = format_prompt(instruction=example)
159
+ ```
160
+
161
+ In the above example, `fmt_ex` is ready to be tokenized and sent through the model.
162
+
163
+ ## Model Description
164
+
165
+ The architecture is a modification of a standard decoder-only transformer.
166
+
167
+ The model has been modified from a standard transformer in the following ways:
168
+ * It uses [FlashAttention](https://arxiv.org/pdf/2205.14135.pdf)
169
+ * It uses [ALiBi (Attention with Linear Biases)](https://arxiv.org/abs/2108.12409) and does not use positional embeddings
170
+ * It does not use biases
171
+
172
+
173
+ | Hyperparameter | Value |
174
+ |----------------|-------|
175
+ |n_parameters | 29.95B |
176
+ |n_layers | 48 |
177
+ | n_heads | 64 |
178
+ | d_model | 7168 |
179
+ | vocab size | 50432 |
180
+ | sequence length | 8192 |
181
+
182
+ ## Data Mix
183
+
184
+ The model was trained on the following data mix:
185
+
186
+ | Data Source | Number of Tokens in Source | Proportion |
187
+ |-------------|----------------------------|------------|
188
+ | competition_math | 1.6 M | 3.66% |
189
+ | cot_gsm8k | 3.36 M | 7.67% |
190
+ | dialogsum | 0.1 M | 0.23% |
191
+ | dolly_hhrlhf | 5.89 M | 13.43% |
192
+ | duorc | 7.8 M | 17.80% |
193
+ | qasper | 8.72 M | 19.90% |
194
+ | quality | 11.29 M | 25.78% |
195
+ | scrolls/summ_screen_fd | 4.97 M | 11.33% |
196
+ | spider | 0.089 M | 0.20% |
197
+
198
+ ## PreTraining Data
199
+
200
+ For more details on the pretraining process, see [MPT-30B](https://huggingface.co/mosaicml/mpt-30b).
201
+
202
+ The data was tokenized using the [EleutherAI/gpt-neox-20b](https://huggingface.co/EleutherAI/gpt-neox-20b) tokenizer.
203
+
204
+ ### Training Configuration
205
+
206
+ This model was trained on 72 A100 40GB GPUs for 8 hours using the [MosaicML Platform](https://www.mosaicml.com/platform).
207
+ The model was trained with sharded data parallelism using [FSDP](https://pytorch.org/docs/stable/fsdp.html) and used the AdamW optimizer.
208
+
209
+ ## Limitations and Biases
210
+
211
+ _The following language is modified from [EleutherAI's GPT-NeoX-20B](https://huggingface.co/EleutherAI/gpt-neox-20b)_
212
+
213
+ MPT-30B-Instruct can produce factually incorrect output, and should not be relied on to produce factually accurate information.
214
+ MPT-30B-Instruct was trained on various public datasets.
215
+ 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.
216
+
217
+
218
+ ## Acknowledgements
219
+
220
+ This model was finetuned by Sam Havens, Alex Trott, and the MosaicML NLP team
221
+
222
+ ## MosaicML Platform
223
+
224
+ 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-30b).
225
+
226
+ ## Disclaimer
227
+
228
+ 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.
229
+
230
+ ## Citation
231
+
232
+ Please cite this model using the following format:
233
+
234
+ ```
235
+ @online{MosaicML2023Introducing,
236
+ author = {MosaicML NLP Team},
237
+ title = {Introducing MPT-30B: Raising the bar
238
+ for open-source foundation models},
239
+ year = {2023},
240
+ url = {www.mosaicml.com/blog/mpt-30b},
241
+ note = {Accessed: 2023-06-22},
242
+ urldate = {2023-06-22}
243
+ }
244
+ ```
mpt-30b-instruct-Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:710cc26442f50f92e7b8760946bd51d8a2a1127cb8e9bcc77ca86200c4e5b072
3
+ size 17151398304