shanearora commited on
Commit
704314f
1 Parent(s): 1ce116f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -7
README.md CHANGED
@@ -25,19 +25,19 @@ The core models released in this batch are the following:
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`. These checkpoints are already available at [OLMo 7B April 2024](https://huggingface.co/allenai/OLMo-1.7-7B-hf)
29
  and will be copied here soon.
30
 
31
  To load a specific model revision with HuggingFace, simply add the argument `revision`:
32
  ```bash
33
- olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-7B-0424-hf", revision="step1000-tokens4B")
34
  ```
35
 
36
  All revisions/branches are listed in the file `revisions.txt`.
37
  Or, you can access all the revisions for the models via the following code snippet:
38
  ```python
39
  from huggingface_hub import list_repo_refs
40
- out = list_repo_refs("allenai/OLMo-7B-0424-hf")
41
  branches = [b.name for b in out.branches]
42
  ```
43
 
@@ -73,8 +73,8 @@ Install Transformers [from source](https://huggingface.co/docs/transformers/en/i
73
  Now, proceed as usual with HuggingFace:
74
  ```python
75
  from transformers import AutoModelForCausalLM, AutoTokenizer
76
- olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-7B-0424-hf")
77
- tokenizer = AutoTokenizer.from_pretrained("allenai/OLMo-7B-0424-hf")
78
  message = ["Language modeling is "]
79
  inputs = tokenizer(message, return_tensors='pt', return_token_type_ids=False)
80
  # optional verifying cuda
@@ -87,12 +87,12 @@ print(tokenizer.batch_decode(response, skip_special_tokens=True)[0])
87
  Alternatively, with the pipeline abstraction:
88
  ```python
89
  from transformers import pipeline
90
- olmo_pipe = pipeline("text-generation", model="allenai/OLMo-7B-0424-hf")
91
  print(olmo_pipe("Language modeling is "))
92
  >> 'Language modeling is a branch of natural language processing that aims to...'
93
  ```
94
 
95
- 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`).
96
  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.
97
 
98
  ### Fine-tuning
 
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`. These checkpoints are already available at [OLMo 7B April 2024](https://huggingface.co/allenai/OLMo-7B-0424-hf)
29
  and will be copied here soon.
30
 
31
  To load a specific model revision with HuggingFace, simply add the argument `revision`:
32
  ```bash
33
+ olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-7B-0724-hf", revision="step1000-tokens4B")
34
  ```
35
 
36
  All revisions/branches are listed in the file `revisions.txt`.
37
  Or, you can access all the revisions for the models via the following code snippet:
38
  ```python
39
  from huggingface_hub import list_repo_refs
40
+ out = list_repo_refs("allenai/OLMo-7B-0724-hf")
41
  branches = [b.name for b in out.branches]
42
  ```
43
 
 
73
  Now, proceed as usual with HuggingFace:
74
  ```python
75
  from transformers import AutoModelForCausalLM, AutoTokenizer
76
+ olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-7B-0724-hf")
77
+ tokenizer = AutoTokenizer.from_pretrained("allenai/OLMo-7B-0724-hf")
78
  message = ["Language modeling is "]
79
  inputs = tokenizer(message, return_tensors='pt', return_token_type_ids=False)
80
  # optional verifying cuda
 
87
  Alternatively, with the pipeline abstraction:
88
  ```python
89
  from transformers import pipeline
90
+ olmo_pipe = pipeline("text-generation", model="allenai/OLMo-7B-0724-hf")
91
  print(olmo_pipe("Language modeling is "))
92
  >> 'Language modeling is a branch of natural language processing that aims to...'
93
  ```
94
 
95
+ Or, you can make this slightly faster by quantizing the model, e.g. `AutoModelForCausalLM.from_pretrained("allenai/OLMo-7B-0724-hf", torch_dtype=torch.float16, load_in_8bit=True)` (requires `bitsandbytes`).
96
  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.
97
 
98
  ### Fine-tuning