GGUF
Composer
MosaicML
llm-foundry
mav23 commited on
Commit
ae89b9d
·
verified ·
1 Parent(s): 48e6890

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +197 -0
  3. mpt-7b-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-chat.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-sa-4.0
3
+ datasets:
4
+ - jeffwan/sharegpt_vicuna
5
+ - Hello-SimpleAI/HC3
6
+ - tatsu-lab/alpaca
7
+ - Anthropic/hh-rlhf
8
+ - victor123/evol_instruct_70k
9
+ tags:
10
+ - Composer
11
+ - MosaicML
12
+ - llm-foundry
13
+ inference: false
14
+ ---
15
+
16
+ # MPT-7B-Chat
17
+
18
+ MPT-7B-Chat is a chatbot-like model for dialogue generation.
19
+ It was built by finetuning [MPT-7B](https://huggingface.co/mosaicml/mpt-7b) on the [ShareGPT-Vicuna](https://huggingface.co/datasets/jeffwan/sharegpt_vicuna), [HC3](https://huggingface.co/datasets/Hello-SimpleAI/HC3),
20
+ [Alpaca](https://huggingface.co/datasets/tatsu-lab/alpaca), [HH-RLHF](https://huggingface.co/datasets/Anthropic/hh-rlhf), and [Evol-Instruct](https://huggingface.co/datasets/victor123/evol_instruct_70k) datasets.
21
+ * License: _CC-By-NC-SA-4.0_ (non-commercial use only)
22
+ * [Demo on Hugging Face Spaces](https://huggingface.co/spaces/mosaicml/mpt-7b-chat)
23
+
24
+
25
+ This model was trained by [MosaicML](https://www.mosaicml.com) and follows a modified decoder-only transformer architecture.
26
+
27
+ ## Model Date
28
+
29
+ May 5, 2023
30
+
31
+ ## Model License
32
+
33
+ _CC-By-NC-SA-4.0_ (non-commercial use only)
34
+
35
+ ## Documentation
36
+
37
+ * [Blog post: Introducing MPT-7B: A New Standard for Open-Source, Commercially Usable LLMs](https://www.mosaicml.com/blog/mpt-7b)
38
+ * [Codebase (mosaicml/llm-foundry repo)](https://github.com/mosaicml/llm-foundry/)
39
+ * Questions: Feel free to contact us via the [MosaicML Community Slack](https://mosaicml.me/slack)!
40
+
41
+ ### Example Dialogue
42
+
43
+ **SamIAm85**:
44
+ >I want you to come up with a tweet based on this summary of the article:
45
+ >"Introducing MPT-7B, the latest entry in our MosaicML Foundation Series.
46
+ >MPT-7B is a transformer trained from scratch on IT tokens of text and code.
47
+ >It is open source and it matches the quality of LLaMA-7B.
48
+ >MPT-7B was trained on the MosaicML platform in 9.5 days with zero human intervention at a cost of ~$200k.
49
+ >Starting today, you can train, finetune, and deploy your own private MPT models, either starting from one of our checkpoints or training from scratch.
50
+ >For inspiration, we are also releasing three finetuned models in addition to the base MPT-7B: MPT-7B-Instruct, MPT-7B-Chat, and MPT-7B-Story Writer-65k+, the last of which uses a context length of 65k tokens!
51
+
52
+ **MPT-7B-Instruct**:
53
+ >Here's my suggestion for a tweet:
54
+ >"Exciting news! @MosaicML has launched #MPT_7B - a new standard for open-source LLMs. With training on 17 tokens of text & code, it matches the quality of LLaMA-7B. Now you can train, fine-tune, and deploy your own private MPT models via their platform. Check out the full blog post here: https://bit.ly/3j6UJzZ"
55
+
56
+ **SamIAm85**:
57
+ >Is there anything you want to say to MosaicML about this exciting news?
58
+
59
+ **MPT-7B-Instruct**:
60
+ > As an Al language model myself, I am very impressed with the advancements made by MosaicML in developing such high-quality open-source LLMs.
61
+ > This new version of MPT-7B is truly impressive and I look forward to seeing what innovative applications developers will create using these powerful tools.
62
+ > Thank you for your hard work and dedication to advancing Al research and development.
63
+
64
+ ## How to Use
65
+
66
+ This model is best used with the MosaicML [llm-foundry repository](https://github.com/mosaicml/llm-foundry) for training and finetuning.
67
+
68
+ ```python
69
+ import transformers
70
+ model = transformers.AutoModelForCausalLM.from_pretrained(
71
+ 'mosaicml/mpt-7b-chat',
72
+ trust_remote_code=True
73
+ )
74
+ ```
75
+ Note: This model requires that `trust_remote_code=True` be passed to the `from_pretrained` method.
76
+ This is because we use a custom `MPT` model architecture that is not yet part of the Hugging Face `transformers` package.
77
+ `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.
78
+
79
+ 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:
80
+ ```python
81
+ import torch
82
+ import transformers
83
+
84
+ name = 'mosaicml/mpt-7b-chat'
85
+
86
+ config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
87
+ config.attn_config['attn_impl'] = 'triton'
88
+ config.init_device = 'cuda:0' # For fast initialization directly on GPU!
89
+
90
+ model = transformers.AutoModelForCausalLM.from_pretrained(
91
+ name,
92
+ config=config,
93
+ torch_dtype=torch.bfloat16, # Load model weights in bfloat16
94
+ trust_remote_code=True
95
+ )
96
+ ```
97
+
98
+ 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:
99
+
100
+ ```python
101
+ import transformers
102
+
103
+ name = 'mosaicml/mpt-7b-chat'
104
+
105
+ config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
106
+ config.max_seq_len = 4096 # (input + output) tokens can now be up to 4096
107
+
108
+ model = transformers.AutoModelForCausalLM.from_pretrained(
109
+ name,
110
+ config=config,
111
+ trust_remote_code=True
112
+ )
113
+ ```
114
+
115
+ This model was trained with the [EleutherAI/gpt-neox-20b](https://huggingface.co/EleutherAI/gpt-neox-20b) tokenizer.
116
+
117
+ ```python
118
+ from transformers import AutoTokenizer
119
+ tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neox-20b")
120
+ ```
121
+
122
+ The model can then be used, for example, within a text-generation pipeline.
123
+ 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).
124
+
125
+ ```python
126
+ from transformers import pipeline
127
+
128
+ pipe = pipeline('text-generation', model=model, tokenizer=tokenizer, device='cuda:0')
129
+
130
+ with torch.autocast('cuda', dtype=torch.bfloat16):
131
+ print(
132
+ pipe('Here is a recipe for vegan banana bread:\n',
133
+ max_new_tokens=100,
134
+ do_sample=True,
135
+ use_cache=True))
136
+ ```
137
+
138
+ ## Model Description
139
+
140
+ The architecture is a modification of a standard decoder-only transformer.
141
+
142
+ The model has been modified from a standard transformer in the following ways:
143
+ * It uses [FlashAttention](https://arxiv.org/pdf/2205.14135.pdf)
144
+ * It uses [ALiBi (Attention with Linear Biases)](https://arxiv.org/abs/2108.12409) and does not use positional embeddings
145
+ * It does not use biases
146
+
147
+
148
+ | Hyperparameter | Value |
149
+ |----------------|-------|
150
+ |n_parameters | 6.7B |
151
+ |n_layers | 32 |
152
+ | n_heads | 32 |
153
+ | d_model | 4096 |
154
+ | vocab size | 50432 |
155
+ | sequence length | 2048 |
156
+
157
+ ### Training Configuration
158
+
159
+ This model was trained on 8 A100-80GBs for about 8.2 hours, followed by training for 6.7 hours on 32 A100-40GBs using the [MosaicML Platform](https://www.mosaicml.com/platform).
160
+ The model was trained with sharded data parallelism using [FSDP](https://pytorch.org/docs/stable/fsdp.html) and used the AdamW optimizer.
161
+
162
+ ## Limitations and Biases
163
+
164
+ _The following language is modified from [EleutherAI's GPT-NeoX-20B](https://huggingface.co/EleutherAI/gpt-neox-20b)_
165
+
166
+ MPT-7B-Chat can produce factually incorrect output, and should not be relied on to produce factually accurate information.
167
+ MPT-7B-Chat was trained on various public datasets.
168
+ 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.
169
+
170
+ ## Acknowledgements
171
+
172
+ This model was finetuned by Sam Havens and the MosaicML NLP team
173
+
174
+ ## Disclaimer
175
+
176
+ 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.
177
+
178
+
179
+ ## MosaicML Platform
180
+
181
+ 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).
182
+
183
+
184
+ ## Citation
185
+
186
+ Please cite this model using the following format:
187
+
188
+ ```
189
+ @online{MosaicML2023Introducing,
190
+ author = {MosaicML NLP Team},
191
+ title = {Introducing MPT-7B: A New Standard for Open-Source, Commercially Usable LLMs},
192
+ year = {2023},
193
+ url = {www.mosaicml.com/blog/mpt-7b},
194
+ note = {Accessed: 2023-03-28}, % change this date
195
+ urldate = {2023-03-28} % change this date
196
+ }
197
+ ```
mpt-7b-chat.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8b3e169e3b7174778aef9bd20bf2d7f489e73d06b92491069b430b5878305b8
3
+ size 3796178624