GGUF
Composer
MosaicML
llm-foundry
conversational
mav23 commited on
Commit
761d48a
1 Parent(s): f202194

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +202 -0
  3. mpt-7b-8k-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-7b-8k-chat.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-7B-Chat-8k
23
+
24
+ MPT-7B-Chat-8k is a chatbot-like model for dialogue generation.
25
+ It was built by finetuning [MPT-7B-8k](https://huggingface.co/mosaicml/mpt-7b-8k) 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
+ This is the same dataset that [MPT-30B-Chat](https://huggingface.co/mosaicml/mpt-30b-chat) was trained on.
28
+ * License: _CC-By-NC-SA-4.0_ (non-commercial use only)
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
+ July 18, 2023
35
+
36
+ ## Model License
37
+
38
+ _CC-By-NC-SA-4.0_ (non-commercial use only)
39
+
40
+ ## Documentation
41
+
42
+ * [Blog post: MPT-7B-8k](https://www.mosaicml.com/blog/long-context-mpt-7b-8k)
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
+ ## How to Use
47
+
48
+ This model is best used with the MosaicML [llm-foundry repository](https://github.com/mosaicml/llm-foundry) for training and finetuning.
49
+
50
+ ```python
51
+ import transformers
52
+ model = transformers.AutoModelForCausalLM.from_pretrained(
53
+ 'mosaicml/mpt-7b-chat-8k',
54
+ trust_remote_code=True
55
+ )
56
+ ```
57
+ Note: This model requires that `trust_remote_code=True` be passed to the `from_pretrained` method.
58
+ This is because we use a custom `MPT` model architecture that is not yet part of the Hugging Face `transformers` package.
59
+ `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.
60
+
61
+ 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:
62
+ ```python
63
+ import torch
64
+ import transformers
65
+
66
+ name = 'mosaicml/mpt-7b-chat-8k'
67
+
68
+ config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
69
+ config.attn_config['attn_impl'] = 'triton' # change this to use triton-based FlashAttention
70
+ config.init_device = 'cuda:0' # For fast initialization directly on GPU!
71
+
72
+ model = transformers.AutoModelForCausalLM.from_pretrained(
73
+ name,
74
+ config=config,
75
+ torch_dtype=torch.bfloat16, # Load model weights in bfloat16
76
+ trust_remote_code=True
77
+ )
78
+ ```
79
+
80
+ 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:
81
+
82
+ ```python
83
+ import transformers
84
+
85
+ name = 'mosaicml/mpt-7b-chat-8k'
86
+
87
+ config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
88
+ config.max_seq_len = 16384 # (input + output) tokens can now be up to 16384
89
+
90
+ model = transformers.AutoModelForCausalLM.from_pretrained(
91
+ name,
92
+ config=config,
93
+ trust_remote_code=True
94
+ )
95
+ ```
96
+
97
+ This model was trained with the MPT-7B-chat tokenizer which is based on the [EleutherAI/gpt-neox-20b](https://huggingface.co/EleutherAI/gpt-neox-20b) tokenizer and includes additional ChatML tokens.
98
+
99
+ ```python
100
+ from transformers import AutoTokenizer
101
+ tokenizer = AutoTokenizer.from_pretrained('mosaicml/mpt-7b-8k')
102
+ ```
103
+
104
+ The model can then be used, for example, within a text-generation pipeline.
105
+ 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).
106
+
107
+ ```python
108
+ from transformers import pipeline
109
+
110
+ with torch.autocast('cuda', dtype=torch.bfloat16):
111
+ inputs = tokenizer('Here is a recipe for vegan banana bread:\n', return_tensors="pt").to('cuda')
112
+ outputs = model.generate(**inputs, max_new_tokens=100)
113
+ print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
114
+
115
+ # or using the HF pipeline
116
+ pipe = pipeline('text-generation', model=model, tokenizer=tokenizer, device='cuda:0')
117
+ with torch.autocast('cuda', dtype=torch.bfloat16):
118
+ print(
119
+ pipe('Here is a recipe for vegan banana bread:\n',
120
+ max_new_tokens=100,
121
+ do_sample=True,
122
+ use_cache=True))
123
+ ```
124
+
125
+ ## Model Description
126
+
127
+ The architecture is a modification of a standard decoder-only transformer.
128
+
129
+ The model has been modified from a standard transformer in the following ways:
130
+ * It uses [FlashAttention](https://arxiv.org/pdf/2205.14135.pdf)
131
+ * It uses [ALiBi (Attention with Linear Biases)](https://arxiv.org/abs/2108.12409) and does not use positional embeddings
132
+ * It does not use biases
133
+
134
+
135
+ | Hyperparameter | Value |
136
+ |----------------|-------|
137
+ |n_parameters | 6.7B |
138
+ |n_layers | 32 |
139
+ | n_heads | 32 |
140
+ | d_model | 4096 |
141
+ | vocab size | 50432 |
142
+ | sequence length | 2048 |
143
+
144
+ ## Data Mix
145
+
146
+ The model was trained on the following data mix:
147
+
148
+ | Data Source | Number of Tokens in Source | Proportion |
149
+ |-------------|----------------------------|------------|
150
+ | Airoboros/GPT4-1.2 | 26.4M | 1.71% |
151
+ | Baize | 55.0M | 3.57% |
152
+ | Camel | 301M | 19.54% |
153
+ | GPTeacher | 7.56M | 0.49% |
154
+ | Guanaco | 15.6M | 1.02% |
155
+ | LongCoversations | 18.4M | 1.19% |
156
+ | ShareGPT | 821M | 53.24% |
157
+ | WizardLM | 297M | 19.23% |
158
+
159
+ "LongConversations" is a GPT3.5/4-generated dataset, details of which will be released at a later date.
160
+
161
+ ### Training Configuration
162
+
163
+ This model was trained on 192 H100s for about 48 minutes using the [MosaicML Platform](https://www.mosaicml.com/platform).
164
+ The model was trained with sharded data parallelism using [FSDP](https://pytorch.org/docs/stable/fsdp.html) and used the AdamW optimizer.
165
+
166
+ ## Limitations and Biases
167
+
168
+ _The following language is modified from [EleutherAI's GPT-NeoX-20B](https://huggingface.co/EleutherAI/gpt-neox-20b)_
169
+
170
+ MPT-7B-Chat-8k can produce factually incorrect output, and should not be relied on to produce factually accurate information.
171
+ MPT-7B-Chat-8k was trained on various public datasets.
172
+ 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.
173
+
174
+ ## Acknowledgements
175
+
176
+ This model was finetuned by the MosaicML NLP team
177
+
178
+ ## Disclaimer
179
+
180
+ 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.
181
+
182
+
183
+ ## MosaicML Platform
184
+
185
+ 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://www.mosaicml.com/get-started?utm_source=huggingface&utm_medium=referral&utm_campaign=mpt-7b-8k).
186
+
187
+
188
+ ## Citation
189
+
190
+ Please cite this model using the following format:
191
+
192
+ ```
193
+ @online{MosaicML2023Introducing,
194
+ author = {MosaicML NLP Team},
195
+ title = {Introducing MPT-30B: Raising the bar
196
+ for open-source foundation models},
197
+ year = {2023},
198
+ url = {www.mosaicml.com/blog/mpt-30b},
199
+ note = {Accessed: 2023-06-22},
200
+ urldate = {2023-06-22}
201
+ }
202
+ ```
mpt-7b-8k-chat.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7087de95683759f967ec8e91bcc2fea43f9d0dd6043a0958d6a67514033efdf7
3
+ size 3796179808