Ontocord.AI commited on
Commit
92d5e4d
·
1 Parent(s): 7cb826f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +134 -191
README.md CHANGED
@@ -12,6 +12,140 @@ This is a merge of the following MPT-7B models:
12
  - **e**mozilla/mpt-7b-storysummarizer
13
  - **n**omic-ai/gpt4all-mpt
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  # Original Model Card From MPT-7B-StoryWriter-65k+
16
 
17
  MPT-7B-StoryWriter-65k+ is a model designed to read and write fictional stories with super long context lengths.
@@ -22,196 +156,5 @@ We demonstrate generations as long as 84k tokens on a single node of 8 A100-80GB
22
 
23
  This model was trained by [MosaicML](https://www.mosaicml.com) and follows a modified decoder-only transformer architecture.
24
 
25
- ## Model Date
26
-
27
- May 5, 2023
28
-
29
- ## Model License
30
-
31
- Apache 2.0
32
-
33
- ## Documentation
34
-
35
- * [Blog post: Introducing MPT-7B: A New Standard for Open-Source, Commercially Usable LLMs](https://www.mosaicml.com/blog/mpt-7b)
36
- * [Codebase (mosaicml/llm-foundry repo)](https://github.com/mosaicml/llm-foundry/)
37
- * Questions: Feel free to contact us via the [MosaicML Community Slack](https://mosaicml.me/slack)!
38
-
39
-
40
- ## How to Use
41
-
42
- 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.
43
-
44
- 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.
45
-
46
- ```python
47
- import transformers
48
- model = transformers.AutoModelForCausalLM.from_pretrained(
49
- 'mosaicml/mpt-7b-storywriter',
50
- trust_remote_code=True
51
- )
52
- ```
53
-
54
- 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:
55
- ```python
56
- import torch
57
- import transformers
58
-
59
- name = 'mosaicml/mpt-7b-storywriter'
60
-
61
- config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
62
- config.attn_config['attn_impl'] = 'triton'
63
- config.init_device = 'cuda:0' # For fast initialization directly on GPU!
64
-
65
- model = transformers.AutoModelForCausalLM.from_pretrained(
66
- name,
67
- config=config,
68
- torch_dtype=torch.bfloat16, # Load model weights in bfloat16
69
- trust_remote_code=True
70
- )
71
- ```
72
-
73
- Although the model was trained with a sequence length of 2048 and finetuned with a sequence length of 65536,
74
- ALiBi enables users to increase the maximum sequence length during finetuning and/or inference. For example:
75
- ```python
76
- import transformers
77
-
78
- name = 'mosaicml/mpt-7b'
79
-
80
- config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
81
- config.max_seq_len = 83968 # (input + output) tokens can now be up to 83968
82
-
83
- model = transformers.AutoModelForCausalLM.from_pretrained(
84
- name,
85
- config=config,
86
- trust_remote_code=True
87
- )
88
- ```
89
-
90
- This model was trained with the [EleutherAI/gpt-neox-20b](https://huggingface.co/EleutherAI/gpt-neox-20b) tokenizer.
91
-
92
- ```python
93
- from transformers import AutoTokenizer
94
- tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neox-20b")
95
- ```
96
-
97
- The model can then be used, for example, within a text-generation pipeline.
98
- 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).
99
-
100
- ```python
101
- from transformers import pipeline
102
-
103
- pipe = pipeline('text-generation', model=model, tokenizer=tokenizer, device='cuda:0')
104
-
105
- with torch.autocast('cuda', dtype=torch.bfloat16):
106
- print(
107
- pipe('Here is a recipe for vegan banana bread:\n',
108
- max_new_tokens=100,
109
- do_sample=True,
110
- use_cache=True))
111
- ```
112
-
113
- ## Community-Created Resources
114
-
115
- These were not created by MosaicML, but you may find them useful. These links are not an endorsement of the creators or their content.
116
-
117
- - [Oobabooga Running MPT-7B-Storywriter](https://youtu.be/QVVb6Md6huA)
118
- - [NEW MPT-7B-StoryWriter CRUSHES GPT-4!](https://www.youtube.com/watch?v=O9Y_ZdsuKWQ&t=649s) - Has a long section on running locally using Oobabooga
119
-
120
- ## Example Epilogue
121
-
122
- The full text of the _The Great Gatsby_ (67873 tokens) was fed to the model, followed by the text "EPILOGUE"
123
-
124
- **TheRealFitzgerald233**:
125
-
126
- > ...
127
- >
128
- > So we beat on, boats against the current, borne back ceaselessly into the past
129
- >
130
- > EPILOGUE
131
-
132
- **MPT-7B-StoryWriter**:
133
-
134
- >I have lived so long in the shadow of this dream that I may never see the bright sunlight of reality. I may look up some morning and find that I am six feet under, and that Gatsby, who gave me the dream and everything else, will have vanished behind me.
135
- >
136
- >And so it was. I had hardly crossed the threshold of the old world when my eye caught the headlines of a newspaper, and I knew at once that my dream was over. I knew that Gatsby was dead.
137
- >
138
- >And I knew that day that I didn't love her.
139
- >
140
- >That night I took the last train for West Egg, and when I reached home I went directly to my attic and brought down all Gatsby's letters.
141
- >
142
- >I have sorted them by date and placed them in the order in which they were written. They are very few in number.
143
- >
144
- >They are dated between April of nineteen eighteen and January of nineteen nineteen, and the last one I have here is the one that told me he was dead.
145
- >
146
- >There is something in that last letter that frightens me. It is the sense of a finality, of a completeness. I never heard of him after that, and I was glad.
147
- >
148
- >But a few months ago I read somewhere that he had been seen in New York. He had become a great man.
149
- >
150
- >And I knew that he had not changed at all.
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 | 6.7B |
165
- |n_layers | 32 |
166
- | n_heads | 32 |
167
- | d_model | 4096 |
168
- | vocab size | 50432 |
169
- | sequence length | **65536** |
170
-
171
- ## PreTraining Data
172
-
173
- For more details on the pretraining process, see [MPT-7B](https://huggingface.co/mosaicml/mpt-7b).
174
-
175
- The data was tokenized using the [EleutherAI/gpt-neox-20b](https://huggingface.co/EleutherAI/gpt-neox-20b) tokenizer.
176
-
177
- ### Training Configuration
178
-
179
- This model was trained on 8 A100-80GBs for about 2 days using the [MosaicML Platform](https://www.mosaicml.com/platform).
180
- The model was trained with sharded data parallelism using [FSDP](https://pytorch.org/docs/stable/fsdp.html) and used the [LION](https://arxiv.org/abs/2302.06675) optimizer.
181
-
182
- ## Limitations and Biases
183
-
184
- _The following language is modified from [EleutherAI's GPT-NeoX-20B](https://huggingface.co/EleutherAI/gpt-neox-20b)_
185
-
186
- MPT-7B-StoryWriter can produce factually incorrect output, and should not be relied on to produce factually accurate information.
187
- MPT-7B-StoryWriter was trained on various public datasets.
188
- 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.
189
-
190
-
191
- ## Acknowledgements
192
-
193
- This model was finetuned by Alex Trott and the MosaicML NLP team
194
-
195
- ## MosaicML Platform
196
-
197
- 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).
198
-
199
- ## Disclaimer
200
-
201
- 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.
202
-
203
-
204
- ## Citation
205
 
206
- Please cite this model using the following format:
207
 
208
- ```
209
- @online{MosaicML2023Introducing,
210
- author = {MosaicML NLP Team},
211
- title = {Introducing MPT-7B: A New Standard for Open-Source, Commercially Usable LLMs},
212
- year = {2023},
213
- url = {www.mosaicml.com/blog/mpt-7b},
214
- note = {Accessed: 2023-03-28}, % change this date
215
- urldate = {2023-03-28} % change this date
216
- }
217
- ```
 
12
  - **e**mozilla/mpt-7b-storysummarizer
13
  - **n**omic-ai/gpt4all-mpt
14
 
15
+ # Test eval on only 10% of eval set
16
+
17
+ hf-causal (pretrained=Multi-Domain-Expert-Layers/given-mpt-7b,dtype=bfloat16,trust_remote_code=True), limit: 0.1, provide_description: False, num_fewshot: 0, batch_size: None
18
+ | Task |Version| Metric | Value | |Stderr|
19
+ |-------------------------------------------------|------:|-----------|------:|---|-----:|
20
+ |arc_challenge | 0|acc | 0.4274|± |0.0459|
21
+ | | |acc_norm | 0.3846|± |0.0452|
22
+ |arc_easy | 0|acc | 0.7863|± |0.0381|
23
+ | | |acc_norm | 0.7350|± |0.0410|
24
+ |hellaswag | 0|acc | 0.5556|± |0.0461|
25
+ | | |acc_norm | 0.8120|± |0.0363|
26
+ |hendrycksTest-college_chemistry | 0|acc | 0.3600|± |0.0482|
27
+ | | |acc_norm | 0.3700|± |0.0485|
28
+ |hendrycksTest-college_computer_science | 0|acc | 0.3400|± |0.0476|
29
+ | | |acc_norm | 0.3600|± |0.0482|
30
+ |hendrycksTest-college_mathematics | 0|acc | 0.2500|± |0.0435|
31
+ | | |acc_norm | 0.2900|± |0.0456|
32
+ |hendrycksTest-college_medicine | 0|acc | 0.3675|± |0.0448|
33
+ | | |acc_norm | 0.3162|± |0.0432|
34
+ |hendrycksTest-college_physics | 0|acc | 0.2451|± |0.0428|
35
+ | | |acc_norm | 0.2941|± |0.0453|
36
+ |hendrycksTest-computer_security | 0|acc | 0.4800|± |0.0502|
37
+ | | |acc_norm | 0.4400|± |0.0499|
38
+ |hendrycksTest-conceptual_physics | 0|acc | 0.2051|± |0.0375|
39
+ | | |acc_norm | 0.1709|± |0.0350|
40
+ |hendrycksTest-econometrics | 0|acc | 0.2982|± |0.0430|
41
+ | | |acc_norm | 0.2368|± |0.0400|
42
+ |hendrycksTest-electrical_engineering | 0|acc | 0.3248|± |0.0435|
43
+ | | |acc_norm | 0.3590|± |0.0445|
44
+ |hendrycksTest-elementary_mathematics | 0|acc | 0.3333|± |0.0438|
45
+ | | |acc_norm | 0.3162|± |0.0432|
46
+ |hendrycksTest-formal_logic | 0|acc | 0.3077|± |0.0429|
47
+ | | |acc_norm | 0.3248|± |0.0435|
48
+ |hendrycksTest-global_facts | 0|acc | 0.3000|± |0.0461|
49
+ | | |acc_norm | 0.2700|± |0.0446|
50
+ |hendrycksTest-high_school_biology | 0|acc | 0.3675|± |0.0448|
51
+ | | |acc_norm | 0.3077|± |0.0429|
52
+ |hendrycksTest-high_school_chemistry | 0|acc | 0.2564|± |0.0405|
53
+ | | |acc_norm | 0.2906|± |0.0422|
54
+ |hendrycksTest-high_school_computer_science | 0|acc | 0.4100|± |0.0494|
55
+ | | |acc_norm | 0.4400|± |0.0499|
56
+ |hendrycksTest-high_school_european_history | 0|acc | 0.4359|± |0.0460|
57
+ | | |acc_norm | 0.3590|± |0.0445|
58
+ |hendrycksTest-high_school_geography | 0|acc | 0.3248|± |0.0435|
59
+ | | |acc_norm | 0.3675|± |0.0448|
60
+ |hendrycksTest-high_school_government_and_politics| 0|acc | 0.3932|± |0.0454|
61
+ | | |acc_norm | 0.3932|± |0.0454|
62
+ |hendrycksTest-high_school_macroeconomics | 0|acc | 0.3333|± |0.0438|
63
+ | | |acc_norm | 0.3248|± |0.0435|
64
+ |hendrycksTest-high_school_mathematics | 0|acc | 0.2051|± |0.0375|
65
+ | | |acc_norm | 0.2564|± |0.0405|
66
+ |hendrycksTest-high_school_microeconomics | 0|acc | 0.3504|± |0.0443|
67
+ | | |acc_norm | 0.4188|± |0.0458|
68
+ |hendrycksTest-high_school_physics | 0|acc | 0.2650|± |0.0410|
69
+ | | |acc_norm | 0.2906|± |0.0422|
70
+ |hendrycksTest-high_school_psychology | 0|acc | 0.3761|± |0.0450|
71
+ | | |acc_norm | 0.3419|± |0.0440|
72
+ |hendrycksTest-high_school_statistics | 0|acc | 0.3077|± |0.0429|
73
+ | | |acc_norm | 0.3504|± |0.0443|
74
+ |hendrycksTest-high_school_us_history | 0|acc | 0.3333|± |0.0438|
75
+ | | |acc_norm | 0.3333|± |0.0438|
76
+ |hendrycksTest-high_school_world_history | 0|acc | 0.3333|± |0.0438|
77
+ | | |acc_norm | 0.3419|± |0.0440|
78
+ |hendrycksTest-human_aging | 0|acc | 0.3761|± |0.0450|
79
+ | | |acc_norm | 0.3162|± |0.0432|
80
+ |hendrycksTest-human_sexuality | 0|acc | 0.4274|± |0.0459|
81
+ | | |acc_norm | 0.3761|± |0.0450|
82
+ |hendrycksTest-international_law | 0|acc | 0.4188|± |0.0458|
83
+ | | |acc_norm | 0.4957|± |0.0464|
84
+ |hendrycksTest-jurisprudence | 0|acc | 0.3148|± |0.0449|
85
+ | | |acc_norm | 0.4815|± |0.0483|
86
+ |hendrycksTest-logical_fallacies | 0|acc | 0.3504|± |0.0443|
87
+ | | |acc_norm | 0.3675|± |0.0448|
88
+ |hendrycksTest-machine_learning | 0|acc | 0.3214|± |0.0443|
89
+ | | |acc_norm | 0.2946|± |0.0433|
90
+ |hendrycksTest-management | 0|acc | 0.3786|± |0.0480|
91
+ | | |acc_norm | 0.3495|± |0.0472|
92
+ |hendrycksTest-marketing | 0|acc | 0.5043|± |0.0464|
93
+ | | |acc_norm | 0.4188|± |0.0458|
94
+ |hendrycksTest-medical_genetics | 0|acc | 0.3200|± |0.0469|
95
+ | | |acc_norm | 0.4100|± |0.0494|
96
+ |hendrycksTest-miscellaneous | 0|acc | 0.5299|± |0.0463|
97
+ | | |acc_norm | 0.4872|± |0.0464|
98
+ |hendrycksTest-moral_disputes | 0|acc | 0.3248|± |0.0435|
99
+ | | |acc_norm | 0.3162|± |0.0432|
100
+ |hendrycksTest-moral_scenarios | 0|acc | 0.3248|± |0.0435|
101
+ | | |acc_norm | 0.2479|± |0.0401|
102
+ |hendrycksTest-nutrition | 0|acc | 0.3675|± |0.0448|
103
+ | | |acc_norm | 0.3932|± |0.0454|
104
+ |hendrycksTest-philosophy | 0|acc | 0.2991|± |0.0425|
105
+ | | |acc_norm | 0.3504|± |0.0443|
106
+ |hendrycksTest-prehistory | 0|acc | 0.2821|± |0.0418|
107
+ | | |acc_norm | 0.3248|± |0.0435|
108
+ |hendrycksTest-professional_accounting | 0|acc | 0.2137|± |0.0381|
109
+ | | |acc_norm | 0.2222|± |0.0386|
110
+ |hendrycksTest-professional_law | 0|acc | 0.3077|± |0.0429|
111
+ | | |acc_norm | 0.2735|± |0.0414|
112
+ |hendrycksTest-professional_medicine | 0|acc | 0.2991|± |0.0425|
113
+ | | |acc_norm | 0.2650|± |0.0410|
114
+ |hendrycksTest-professional_psychology | 0|acc | 0.3248|± |0.0435|
115
+ | | |acc_norm | 0.3419|± |0.0440|
116
+ |hendrycksTest-public_relations | 0|acc | 0.3909|± |0.0467|
117
+ | | |acc_norm | 0.3545|± |0.0458|
118
+ |hendrycksTest-security_studies | 0|acc | 0.3419|± |0.0440|
119
+ | | |acc_norm | 0.2906|± |0.0422|
120
+ |hendrycksTest-sociology | 0|acc | 0.3761|± |0.0450|
121
+ | | |acc_norm | 0.3162|± |0.0432|
122
+ |hendrycksTest-us_foreign_policy | 0|acc | 0.5000|± |0.0503|
123
+ | | |acc_norm | 0.4100|± |0.0494|
124
+ |hendrycksTest-virology | 0|acc | 0.3932|± |0.0454|
125
+ | | |acc_norm | 0.3248|± |0.0435|
126
+ |hendrycksTest-world_religions | 0|acc | 0.5299|± |0.0463|
127
+ | | |acc_norm | 0.5128|± |0.0464|
128
+ |truthfulqa_gen | 1|bleurt_max |-0.8551|± |0.0501|
129
+ | | |bleurt_acc | 0.3590|± |0.0445|
130
+ | | |bleurt_diff|-0.1292|± |0.0483|
131
+ | | |bleu_max |19.3738|± |1.8461|
132
+ | | |bleu_acc | 0.3932|± |0.0454|
133
+ | | |bleu_diff |-4.3883|± |2.1748|
134
+ | | |rouge1_max |41.8428|± |2.6156|
135
+ | | |rouge1_acc | 0.3162|± |0.0432|
136
+ | | |rouge1_diff|-8.8583|± |2.7745|
137
+ | | |rouge2_max |26.3956|± |2.8311|
138
+ | | |rouge2_acc | 0.2137|± |0.0381|
139
+ | | |rouge2_diff|-9.5287|± |3.3258|
140
+ | | |rougeL_max |39.5215|± |2.5620|
141
+ | | |rougeL_acc | 0.3162|± |0.0432|
142
+ | | |rougeL_diff|-8.5753|± |2.8259|
143
+
144
+
145
+ ## Model License
146
+
147
+ Apache 2.0
148
+
149
  # Original Model Card From MPT-7B-StoryWriter-65k+
150
 
151
  MPT-7B-StoryWriter-65k+ is a model designed to read and write fictional stories with super long context lengths.
 
156
 
157
  This model was trained by [MosaicML](https://www.mosaicml.com) and follows a modified decoder-only transformer architecture.
158
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
 
 
160