GGUF
Composer
MosaicML
llm-foundry
conversational
mav23 commited on
Commit
05b66a5
·
verified ·
1 Parent(s): 165379d

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +229 -0
  3. mpt-30b-chat.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-chat.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - timdettmers/openassistant-guanaco
8
+ - camel-ai/math
9
+ - camel-ai/biology
10
+ - camel-ai/chemistry
11
+ - camel-ai/ai_society
12
+ - jondurbin/airoboros-gpt4-1.2
13
+ - LongConversations
14
+ - camel-ai/physics
15
+ tags:
16
+ - Composer
17
+ - MosaicML
18
+ - llm-foundry
19
+ inference: false
20
+ ---
21
+
22
+ # MPT-30B-Chat
23
+
24
+ MPT-30B-Chat is a chatbot-like model for dialogue generation.
25
+ 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),
26
+ [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.
27
+ * License: _CC-By-NC-SA-4.0_ (non-commercial use only)
28
+
29
+
30
+ This model was trained by [MosaicML](https://www.mosaicml.com) and follows a modified decoder-only transformer architecture.
31
+
32
+ ## Model Date
33
+
34
+ June 22, 2023
35
+
36
+ ## Model License
37
+
38
+ _CC-By-NC-SA-4.0_ (non-commercial use only)
39
+
40
+ ## Documentation
41
+
42
+ * [Blog post: Raising the bar for open-source foundation models](https://www.mosaicml.com/blog/mpt-30b)
43
+ * [Codebase (mosaicml/llm-foundry repo)](https://github.com/mosaicml/llm-foundry/)
44
+ * Questions: Feel free to contact us via the [MosaicML Community Slack](https://mosaicml.me/slack)!
45
+
46
+ ### Example Dialogue
47
+
48
+ **ksreenivasan**:
49
+ > I want you to come up with a tweet based on this summary of the article:
50
+ >
51
+ > 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
52
+ > 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
53
+ > following and multi-turn conversations, respectively.
54
+ > 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;
55
+ > see MPT-7B-StoryWriter), support for context-length extrapolation via ALiBi, and efficient inference + training performance via FlashAttention. It also has strong coding
56
+ > abilities thanks to its pretraining data mixture.
57
+
58
+
59
+
60
+ **MPT-30B-Chat**:
61
+ > "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
62
+ > finely-tuned models for exceptional instruction following and multi-turn conversations. Unleash the potential of an 8k token context window, ALiBi support, and FlashAttention.
63
+ > Experience the future of AI with MosaicML! #AI #ML #innovation"
64
+
65
+ **ksreenivasan**:
66
+ > Is there anything you want to say to MosaicML about this exciting news?
67
+
68
+ **MPT-30B-Chat**:
69
+ > 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.
70
+ > 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.
71
+ > Congratulations to the MosaicML team on this incredible achievement!
72
+
73
+ ## How to Use
74
+
75
+ This model is best used with the MosaicML [llm-foundry repository](https://github.com/mosaicml/llm-foundry) for training and finetuning.
76
+
77
+ ```python
78
+ import transformers
79
+ model = transformers.AutoModelForCausalLM.from_pretrained(
80
+ 'mosaicml/mpt-30b-chat',
81
+ trust_remote_code=True
82
+ )
83
+ ```
84
+ Note: This model requires that `trust_remote_code=True` be passed to the `from_pretrained` method.
85
+ This is because we use a custom `MPT` model architecture that is not yet part of the Hugging Face `transformers` package.
86
+ `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.
87
+
88
+ 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:
89
+ ```python
90
+ import torch
91
+ import transformers
92
+
93
+ name = 'mosaicml/mpt-30b-chat'
94
+
95
+ config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
96
+ config.attn_config['attn_impl'] = 'triton' # change this to use triton-based FlashAttention
97
+ config.init_device = 'cuda:0' # For fast initialization directly on GPU!
98
+
99
+ model = transformers.AutoModelForCausalLM.from_pretrained(
100
+ name,
101
+ config=config,
102
+ torch_dtype=torch.bfloat16, # Load model weights in bfloat16
103
+ trust_remote_code=True
104
+ )
105
+ ```
106
+
107
+ 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:
108
+
109
+ ```python
110
+ import transformers
111
+
112
+ name = 'mosaicml/mpt-30b-chat'
113
+
114
+ config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
115
+ config.max_seq_len = 16384 # (input + output) tokens can now be up to 16384
116
+
117
+ model = transformers.AutoModelForCausalLM.from_pretrained(
118
+ name,
119
+ config=config,
120
+ trust_remote_code=True
121
+ )
122
+ ```
123
+
124
+ 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.
125
+
126
+ ```python
127
+ from transformers import AutoTokenizer
128
+ tokenizer = AutoTokenizer.from_pretrained('mosaicml/mpt-30b')
129
+ ```
130
+
131
+ The model can then be used, for example, within a text-generation pipeline.
132
+ 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).
133
+
134
+ ```python
135
+ from transformers import pipeline
136
+
137
+ with torch.autocast('cuda', dtype=torch.bfloat16):
138
+ inputs = tokenizer('Here is a recipe for vegan banana bread:\n', return_tensors="pt").to('cuda')
139
+ outputs = model.generate(**inputs, max_new_tokens=100)
140
+ print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
141
+
142
+ # or using the HF pipeline
143
+ pipe = pipeline('text-generation', model=model, tokenizer=tokenizer, device='cuda:0')
144
+ with torch.autocast('cuda', dtype=torch.bfloat16):
145
+ print(
146
+ pipe('Here is a recipe for vegan banana bread:\n',
147
+ max_new_tokens=100,
148
+ do_sample=True,
149
+ use_cache=True))
150
+ ```
151
+
152
+ ## Model Description
153
+
154
+ The architecture is a modification of a standard decoder-only transformer.
155
+
156
+ The model has been modified from a standard transformer in the following ways:
157
+ * It uses [FlashAttention](https://arxiv.org/pdf/2205.14135.pdf)
158
+ * It uses [ALiBi (Attention with Linear Biases)](https://arxiv.org/abs/2108.12409) and does not use positional embeddings
159
+ * It does not use biases
160
+
161
+
162
+ | Hyperparameter | Value |
163
+ |----------------|-------|
164
+ |n_parameters | 29.95B |
165
+ |n_layers | 48 |
166
+ | n_heads | 64 |
167
+ | d_model | 7168 |
168
+ | vocab size | 50432 |
169
+ | sequence length | 8192 |
170
+
171
+ ## Data Mix
172
+
173
+ The model was trained on the following data mix:
174
+
175
+ | Data Source | Number of Tokens in Source | Proportion |
176
+ |-------------|----------------------------|------------|
177
+ | Airoboros/GPT4-1.2 | 26.4M | 1.71% |
178
+ | Baize | 55.0M | 3.57% |
179
+ | Camel | 301M | 19.54% |
180
+ | GPTeacher | 7.56M | 0.49% |
181
+ | Guanaco | 15.6M | 1.02% |
182
+ | LongCoversations | 18.4M | 1.19% |
183
+ | ShareGPT | 821M | 53.24% |
184
+ | WizardLM | 297M | 19.23% |
185
+
186
+ "LongConversations" is a GPT3.5/4-generated dataset, details of which will be released at a later date.
187
+
188
+ ### Training Configuration
189
+
190
+ This model was trained on 64 H100s for about 7.6 hours using the [MosaicML Platform](https://www.mosaicml.com/platform).
191
+ The model was trained with sharded data parallelism using [FSDP](https://pytorch.org/docs/stable/fsdp.html) and used the AdamW optimizer.
192
+
193
+ ## Limitations and Biases
194
+
195
+ _The following language is modified from [EleutherAI's GPT-NeoX-20B](https://huggingface.co/EleutherAI/gpt-neox-20b)_
196
+
197
+ MPT-30B-Chat can produce factually incorrect output, and should not be relied on to produce factually accurate information.
198
+ MPT-30B-Chat was trained on various public datasets.
199
+ 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.
200
+
201
+ ## Acknowledgements
202
+
203
+ This model was finetuned by Sam Havens and the MosaicML NLP team
204
+
205
+ ## Disclaimer
206
+
207
+ 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.
208
+
209
+
210
+ ## MosaicML Platform
211
+
212
+ 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).
213
+
214
+
215
+ ## Citation
216
+
217
+ Please cite this model using the following format:
218
+
219
+ ```
220
+ @online{MosaicML2023Introducing,
221
+ author = {MosaicML NLP Team},
222
+ title = {Introducing MPT-30B: Raising the bar
223
+ for open-source foundation models},
224
+ year = {2023},
225
+ url = {www.mosaicml.com/blog/mpt-30b},
226
+ note = {Accessed: 2023-06-22},
227
+ urldate = {2023-06-22}
228
+ }
229
+ ```
mpt-30b-chat.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d81990fc302b6b45b8077b1dbad1663ac6b36faa833c1143c188410ad9be728c
3
+ size 16948304320