Triangle104 commited on
Commit
943ee09
·
verified ·
1 Parent(s): 6d02d30

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +230 -0
README.md CHANGED
@@ -15,6 +15,236 @@ tags:
15
  This model was converted to GGUF format from [`allenai/OLMo-2-1124-7B`](https://huggingface.co/allenai/OLMo-2-1124-7B) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
16
  Refer to the [original model card](https://huggingface.co/allenai/OLMo-2-1124-7B) for more details on the model.
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  ## Use with llama.cpp
19
  Install llama.cpp through brew (works on Mac and Linux)
20
 
 
15
  This model was converted to GGUF format from [`allenai/OLMo-2-1124-7B`](https://huggingface.co/allenai/OLMo-2-1124-7B) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
16
  Refer to the [original model card](https://huggingface.co/allenai/OLMo-2-1124-7B) for more details on the model.
17
 
18
+ ---
19
+ Model details:
20
+ -
21
+ We introduce OLMo 2, a new family of 7B and 13B models featuring a
22
+ 9-point increase in MMLU, among other evaluation improvements, compared
23
+ to the original OLMo 7B model. These gains come from training on
24
+ OLMo-mix-1124 and Dolmino-mix-1124 datasets and staged training
25
+ approach.
26
+
27
+ OLMo is a series of Open Language Models
28
+ designed to enable the science of language models.
29
+ These models are trained on the Dolma dataset. We are releasing all
30
+ code, checkpoints, logs (coming soon), and associated training details.
31
+
32
+ Installation
33
+
34
+
35
+
36
+
37
+ OLMo 2 will be supported in the next version of Transformers, and you need to install it from the main branch using:
38
+
39
+
40
+ pip install --upgrade git+https://github.com/huggingface/transformers.git
41
+
42
+ Inference
43
+
44
+
45
+
46
+ You can use OLMo with the standard HuggingFace transformers library:
47
+
48
+
49
+ from transformers import AutoModelForCausalLM, AutoTokenizer
50
+ olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-1124-7B")
51
+ tokenizer = AutoTokenizer.from_pretrained("allenai/OLMo-2-1124-7B")
52
+ message = ["Language modeling is "]
53
+ inputs = tokenizer(message, return_tensors='pt', return_token_type_ids=False)
54
+
55
+ optional verifying cuda
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+ inputs = {k: v.to('cuda') for k,v in inputs.items()}
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+ olmo = olmo.to('cuda')
76
+
77
+
78
+
79
+
80
+ response = olmo.generate(**inputs, max_new_tokens=100, do_sample=True, top_k=50, top_p=0.95)
81
+ print(tokenizer.batch_decode(response, skip_special_tokens=True)[0])
82
+
83
+ 'Language modeling is a key component of any text-based application, but its effectiveness...'
84
+
85
+ For faster performance, you can quantize the model using the following method:
86
+
87
+ AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-1124-7B",
88
+ torch_dtype=torch.float16,
89
+ load_in_8bit=True) # Requires bitsandbytes
90
+
91
+
92
+ The quantized model is more sensitive to data
93
+ types and CUDA operations. To avoid potential issues, it's recommended
94
+ to pass the inputs directly to CUDA using:
95
+
96
+ inputs.input_ids.to('cuda')
97
+
98
+ We have released checkpoints for these models. For pretraining, the
99
+ naming convention is stepXXX-tokensYYYB. For checkpoints with
100
+ ingredients of the soup, the naming convention is
101
+ stage2-ingredientN-stepXXX-tokensYYYB
102
+
103
+ To load a specific model revision with HuggingFace, simply add the argument revision:
104
+
105
+ olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-1124-7B", revision="step1000-tokens5B")
106
+
107
+ Or, you can access all the revisions for the models via the following code snippet:
108
+
109
+ from huggingface_hub import list_repo_refs
110
+ out = list_repo_refs("allenai/OLMo-2-1124-7B")
111
+ branches = [b.name for b in out.branches]
112
+
113
+ Fine-tuning
114
+
115
+
116
+
117
+ Model fine-tuning can be done from the final checkpoint (the main
118
+ revision of this model) or many intermediate checkpoints. Two recipes
119
+ for tuning are available.
120
+
121
+ Fine-tune with the OLMo repository:
122
+
123
+ torchrun --nproc_per_node=8 scripts/train.py {path_to_train_config}
124
+ --data.paths=[{path_to_data}/input_ids.npy]
125
+ --data.label_mask_paths=[{path_to_data}/label_mask.npy]
126
+ --load_path={path_to_checkpoint}
127
+ --reset_trainer_state
128
+
129
+
130
+ For more documentation, see the GitHub readme.
131
+
132
+
133
+ Further fine-tuning support is being developing in AI2's Open Instruct repository. Details are here.
134
+
135
+ Model Description
136
+
137
+
138
+
139
+ Developed by: Allen Institute for AI (Ai2)
140
+ Model type: a Transformer style autoregressive language model.
141
+ Language(s) (NLP): English
142
+ License: The code and model are released under Apache 2.0.
143
+ Contact: Technical inquiries: [email protected]. Press: [email protected]
144
+ Date cutoff: Dec. 2023.
145
+
146
+ Model Sources
147
+
148
+
149
+
150
+ Project Page: https://allenai.org/olmo
151
+ Repositories:
152
+ Core repo (training, inference, fine-tuning etc.): https://github.com/allenai/OLMo
153
+ Evaluation code: https://github.com/allenai/OLMo-Eval
154
+ Further fine-tuning code: https://github.com/allenai/open-instruct
155
+
156
+ Paper: Coming soon
157
+
158
+ Pretraining
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+ OLMo 2 7B
170
+ OLMo 2 13B
171
+
172
+ Pretraining Stage 1
173
+ (OLMo-Mix-1124)
174
+ 4 trillion tokens
175
+ (1 epoch)
176
+ 5 trillion tokens
177
+ (1.2 epochs)
178
+
179
+ Pretraining Stage 2
180
+ (Dolmino-Mix-1124)
181
+ 50B tokens (3 runs)
182
+ merged
183
+ 100B tokens (3 runs)
184
+ 300B tokens (1 run)
185
+ merged
186
+
187
+ Post-training
188
+ (Tulu 3 SFT OLMo mix)
189
+ SFT + DPO + PPO
190
+ (preference mix)
191
+ SFT + DPO + PPO
192
+ (preference mix)
193
+
194
+ Stage 1: Initial Pretraining
195
+
196
+
197
+
198
+ Dataset: OLMo-Mix-1124 (3.9T tokens)
199
+ Coverage: 90%+ of total pretraining budget
200
+ 7B Model: ~1 epoch
201
+ 13B Model: 1.2 epochs (5T tokens)
202
+
203
+ Stage 2: Fine-tuning
204
+
205
+
206
+
207
+ Dataset: Dolmino-Mix-1124 (843B tokens)
208
+ Three training mixes:
209
+ 50B tokens
210
+ 100B tokens
211
+ 300B tokens
212
+
213
+
214
+ Mix composition: 50% high-quality data + academic/Q&A/instruction/math content
215
+
216
+ Model Merging
217
+
218
+
219
+
220
+ 7B Model: 3 versions trained on 50B mix, merged via model souping
221
+ 13B Model: 3 versions on 100B mix + 1 version on 300B mix, merged for final checkpoint
222
+
223
+ Bias, Risks, and Limitations
224
+
225
+
226
+
227
+ Like any base language model or fine-tuned model without safety
228
+ filtering, these models can easily be prompted by users to generate
229
+ harmful and sensitive content. Such content may also be produced
230
+ unintentionally, especially in cases involving bias, so we recommend
231
+ that users consider the risks when applying this technology.
232
+ Additionally, many statements from OLMo or any LLM are often inaccurate,
233
+ so facts should be verified.
234
+
235
+ Citation
236
+
237
+
238
+
239
+ A technical manuscript is forthcoming!
240
+
241
+ Model Card Contact
242
+
243
+
244
+
245
+ For errors in this model card, contact [email protected].
246
+
247
+ ---
248
  ## Use with llama.cpp
249
  Install llama.cpp through brew (works on Mac and Linux)
250