guipenedo HF staff commited on
Commit
6ea568a
1 Parent(s): ee29d8d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -5
README.md CHANGED
@@ -31,11 +31,11 @@ It is important to note that the primary intended use case of this model is to c
31
  # pip install -q transformers
32
  from transformers import AutoModelForCausalLM, AutoTokenizer
33
 
34
- checkpoint = "HuggingFaceFW/ablation-model-fineweb-edu"
35
  device = "cuda" # for GPU usage or "cpu" for CPU usage
36
 
37
- tokenizer = AutoTokenizer.from_pretrained(checkpoint)
38
- model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
39
 
40
  inputs = tokenizer.encode("Machine Learning is", return_tensors="pt").to(device)
41
  outputs = model.generate(inputs)
@@ -48,12 +48,12 @@ We are releasing intermediate checkpoints for this model at intervals of every 1
48
 
49
  You can load a specific model revision with `transformers` using the argument `revision`:
50
  ```python
51
- model = AutoModelForCausalLM.from_pretrained(checkpoint, revision="step-001000-2BT")
52
  ```
53
  You can access all the revisions for the models via the following code:
54
  ```python
55
  from huggingface_hub import list_repo_refs
56
- out = list_repo_refs(checkpoint)
57
  branches = [b.name for b in out.branches]
58
  ```
59
 
 
31
  # pip install -q transformers
32
  from transformers import AutoModelForCausalLM, AutoTokenizer
33
 
34
+ model = "HuggingFaceFW/ablation-model-fineweb-edu"
35
  device = "cuda" # for GPU usage or "cpu" for CPU usage
36
 
37
+ tokenizer = AutoTokenizer.from_pretrained(model)
38
+ model = AutoModelForCausalLM.from_pretrained(model).to(device)
39
 
40
  inputs = tokenizer.encode("Machine Learning is", return_tensors="pt").to(device)
41
  outputs = model.generate(inputs)
 
48
 
49
  You can load a specific model revision with `transformers` using the argument `revision`:
50
  ```python
51
+ model = AutoModelForCausalLM.from_pretrained("HuggingFaceFW/ablation-model-fineweb-edu", revision="step-001000-2BT")
52
  ```
53
  You can access all the revisions for the models via the following code:
54
  ```python
55
  from huggingface_hub import list_repo_refs
56
+ out = list_repo_refs("HuggingFaceFW/ablation-model-fineweb-edu")
57
  branches = [b.name for b in out.branches]
58
  ```
59