Update README.md
Browse files
README.md
CHANGED
@@ -9,10 +9,7 @@ language:
|
|
9 |
|
10 |
<img src="https://allenai.org/olmo/olmo-7b-animation.gif" alt="OLMo Logo" width="800" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
|
11 |
|
12 |
-
# Model Card for OLMo
|
13 |
-
|
14 |
-
OLMo 1.7 7B is the latest version of the original [OLMo 7B](https://huggingface.co/allenai/OLMo-7B) model rocking a 24 point increase in MMLU, among other evaluations improvements, from an improved version of the Dolma dataset and staged training.
|
15 |
-
**This version is for direct use with HuggingFace Transformers** from v4.40 on.
|
16 |
|
17 |
OLMo is a series of **O**pen **L**anguage **Mo**dels designed to enable the science of language models.
|
18 |
The OLMo models are trained on the [Dolma](https://huggingface.co/datasets/allenai/dolma) dataset.
|
@@ -23,30 +20,25 @@ We release all code, checkpoints, logs, and details involved in training these m
|
|
23 |
The core models released in this batch are the following:
|
24 |
| Size | Training Tokens | Layers | Hidden Size | Attention Heads | Context Length |
|
25 |
|------|--------|---------|-------------|-----------------|----------------|
|
26 |
-
| [OLMo 1B](https://huggingface.co/allenai/OLMo-1B)
|
27 |
-
| [OLMo 7B](https://huggingface.co/allenai/OLMo-7B) | 2.
|
28 |
-
| [OLMo 7B Twin 2T](https://huggingface.co/allenai/OLMo-7B-Twin-2T) | 2 Trillion | 32 | 4096 | 32 | 2048 |
|
29 |
-
| [OLMo 1.7-7B](https://huggingface.co/allenai/OLMo-1.7-7B) | 2.05 Trillion | 32 | 4096 | 32 | 4096 |
|
30 |
-
|
31 |
-
*Note: OLMo 1.7-7B also includes QKV clipping.*
|
32 |
|
33 |
|
34 |
[Coming soon] We are releasing many checkpoints for these models, for every 1000 training steps.
|
35 |
-
The naming convention is `
|
36 |
|
37 |
To load a specific model revision with HuggingFace, simply add the argument `revision`:
|
38 |
```bash
|
39 |
-
olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-
|
40 |
```
|
41 |
|
42 |
All revisions/branches are listed in the file `revisions.txt`.
|
43 |
Or, you can access all the revisions for the models via the following code snippet:
|
44 |
```python
|
45 |
from huggingface_hub import list_repo_refs
|
46 |
-
out = list_repo_refs("allenai/OLMo-
|
47 |
branches = [b.name for b in out.branches]
|
48 |
```
|
49 |
-
A few revisions were lost due to an error, but the vast majority are present.
|
50 |
|
51 |
### Model Description
|
52 |
|
@@ -80,8 +72,8 @@ Install Transformers [from source](https://huggingface.co/docs/transformers/en/i
|
|
80 |
Now, proceed as usual with HuggingFace:
|
81 |
```python
|
82 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
83 |
-
olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-
|
84 |
-
tokenizer = AutoTokenizer.from_pretrained("allenai/OLMo-
|
85 |
message = ["Language modeling is "]
|
86 |
inputs = tokenizer(message, return_tensors='pt', return_token_type_ids=False)
|
87 |
# optional verifying cuda
|
@@ -94,20 +86,14 @@ print(tokenizer.batch_decode(response, skip_special_tokens=True)[0])
|
|
94 |
Alternatively, with the pipeline abstraction:
|
95 |
```python
|
96 |
from transformers import pipeline
|
97 |
-
olmo_pipe = pipeline("text-generation", model="allenai/OLMo-
|
98 |
print(olmo_pipe("Language modeling is "))
|
99 |
>> 'Language modeling is a branch of natural language processing that aims to...'
|
100 |
```
|
101 |
|
102 |
-
Or, you can make this slightly faster by quantizing the model, e.g. `AutoModelForCausalLM.from_pretrained("allenai/OLMo-
|
103 |
The quantized model is more sensitive to typing / cuda, so it is recommended to pass the inputs as `inputs.input_ids.to('cuda')` to avoid potential issues.
|
104 |
|
105 |
-
Note, you may see the following error if `ai2-olmo` is not installed correctly, which is caused by internal Python check naming. We'll update the code soon to make this error clearer.
|
106 |
-
```bash
|
107 |
-
raise ImportError(
|
108 |
-
ImportError: This modeling file requires the following packages that were not found in your environment: hf_olmo. Run `pip install hf_olmo`
|
109 |
-
```
|
110 |
-
|
111 |
### Fine-tuning
|
112 |
Model fine-tuning can be done from the final checkpoint (the `main` revision of this model) or many intermediate checkpoints. Two recipes for tuning are available.
|
113 |
1. Fine-tune with the OLMo repository:
|
|
|
9 |
|
10 |
<img src="https://allenai.org/olmo/olmo-7b-animation.gif" alt="OLMo Logo" width="800" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
|
11 |
|
12 |
+
# Model Card for OLMo 7B July 2024
|
|
|
|
|
|
|
13 |
|
14 |
OLMo is a series of **O**pen **L**anguage **Mo**dels designed to enable the science of language models.
|
15 |
The OLMo models are trained on the [Dolma](https://huggingface.co/datasets/allenai/dolma) dataset.
|
|
|
20 |
The core models released in this batch are the following:
|
21 |
| Size | Training Tokens | Layers | Hidden Size | Attention Heads | Context Length |
|
22 |
|------|--------|---------|-------------|-----------------|----------------|
|
23 |
+
| [OLMo 1B July 2024](https://huggingface.co/allenai/OLMo-1B-0724-hf) | 3.05 Trillion | 16 | 2048 | 16 | 4096 |
|
24 |
+
| [OLMo 7B July 2024](https://huggingface.co/allenai/OLMo-7B-0724-hf) | 2.75 Trillion | 32 | 4096 | 32 | 4096 |
|
|
|
|
|
|
|
|
|
25 |
|
26 |
|
27 |
[Coming soon] We are releasing many checkpoints for these models, for every 1000 training steps.
|
28 |
+
The naming convention is `stepXXX-tokensYYYB`.
|
29 |
|
30 |
To load a specific model revision with HuggingFace, simply add the argument `revision`:
|
31 |
```bash
|
32 |
+
olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-7B-0424-hf", revision="step1000-tokens4B")
|
33 |
```
|
34 |
|
35 |
All revisions/branches are listed in the file `revisions.txt`.
|
36 |
Or, you can access all the revisions for the models via the following code snippet:
|
37 |
```python
|
38 |
from huggingface_hub import list_repo_refs
|
39 |
+
out = list_repo_refs("allenai/OLMo-7B-0424-hf")
|
40 |
branches = [b.name for b in out.branches]
|
41 |
```
|
|
|
42 |
|
43 |
### Model Description
|
44 |
|
|
|
72 |
Now, proceed as usual with HuggingFace:
|
73 |
```python
|
74 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
75 |
+
olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-7B-0424-hf")
|
76 |
+
tokenizer = AutoTokenizer.from_pretrained("allenai/OLMo-7B-0424-hf")
|
77 |
message = ["Language modeling is "]
|
78 |
inputs = tokenizer(message, return_tensors='pt', return_token_type_ids=False)
|
79 |
# optional verifying cuda
|
|
|
86 |
Alternatively, with the pipeline abstraction:
|
87 |
```python
|
88 |
from transformers import pipeline
|
89 |
+
olmo_pipe = pipeline("text-generation", model="allenai/OLMo-7B-0424-hf")
|
90 |
print(olmo_pipe("Language modeling is "))
|
91 |
>> 'Language modeling is a branch of natural language processing that aims to...'
|
92 |
```
|
93 |
|
94 |
+
Or, you can make this slightly faster by quantizing the model, e.g. `AutoModelForCausalLM.from_pretrained("allenai/OLMo-7B-0424-hf", torch_dtype=torch.float16, load_in_8bit=True)` (requires `bitsandbytes`).
|
95 |
The quantized model is more sensitive to typing / cuda, so it is recommended to pass the inputs as `inputs.input_ids.to('cuda')` to avoid potential issues.
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
### Fine-tuning
|
98 |
Model fine-tuning can be done from the final checkpoint (the `main` revision of this model) or many intermediate checkpoints. Two recipes for tuning are available.
|
99 |
1. Fine-tune with the OLMo repository:
|