baileyk commited on
Commit
1d31d11
·
verified ·
1 Parent(s): 4a61f36

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +19 -0
README.md CHANGED
@@ -25,6 +25,25 @@ These checkpoints use the same architecture and starting checkpoint as the offic
25
  - stage1-step20000-tokens42B
26
  - stage1-step30000-tokens63B
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  ## Model Description
29
  - Developed by: Allen Institute for AI (Ai2)
30
  - Model type: a Transformer style autoregressive language model.
 
25
  - stage1-step20000-tokens42B
26
  - stage1-step30000-tokens63B
27
 
28
+ ## Inference
29
+ You can access these checkpoints using the standard Hugging Face Transformers library:
30
+
31
+ ```
32
+ from transformers import AutoModelForCausalLM, AutoTokenizer
33
+ olmo_early_training = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-0425-1B-early-training")
34
+ tokenizer = AutoTokenizer.from_pretrained("allenai/OLMo-2-0425-1B-early-training")
35
+ message = ["The capital of the United States is "]
36
+ inputs = tokenizer(message, return_tensors='pt', return_token_type_ids=False)
37
+
38
+ response = olmo_early_training.generate(**inputs, max_new_tokens=100, do_sample=True, top_k=50, top_p=0.95)
39
+ print(tokenizer.batch_decode(response, skip_special_tokens=True)[0])
40
+ ```
41
+
42
+ To access a specific checkpoint, you can specify the revision:
43
+ ```
44
+ olmo_early_training = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-0425-1B-early-training", revision="stage1-step20000-tokens42B")
45
+ ```
46
+
47
  ## Model Description
48
  - Developed by: Allen Institute for AI (Ai2)
49
  - Model type: a Transformer style autoregressive language model.