sfanm commited on
Commit
a6f0b97
Β·
verified Β·
1 Parent(s): 067b29c

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +9 -4
README.md CHANGED
@@ -20,12 +20,17 @@ nanochat-style **depth-24** decoder β€” 24 layers Γ— 1536 hidden Γ— 12 heads, Sw
20
 
21
  **Metrics.** Base checkpoint (pre-SFT) β€” evaluate after SFT. Corresponding SFT: `d24-sft-v1base-mathheavy-3.7B` (GSM8K 5.46%).
22
 
23
- ## Load
 
 
 
24
  ```python
25
  from transformers import AutoModelForCausalLM, AutoTokenizer
26
- m = "sfanm/d24-midtrain-v1base-mathheavy-3.7B"
27
- tok = AutoTokenizer.from_pretrained(m)
28
- model = AutoModelForCausalLM.from_pretrained(m, torch_dtype="bfloat16")
 
 
29
  ```
30
 
31
  *Research checkpoint from a from-scratch nanochat-d24 replication (pretrain β†’ midtrain β†’ SFT β†’ RL) on NERSC Perlmutter. Trained on third-party corpora (ClimbMix, FineMath, OpenMath, MetaMath, OpenThoughts, OLMo-3 Dolmino, SmolTalk, …) β€” see those datasets' licenses; provided as-is for research.*
 
20
 
21
  **Metrics.** Base checkpoint (pre-SFT) β€” evaluate after SFT. Corresponding SFT: `d24-sft-v1base-mathheavy-3.7B` (GSM8K 5.46%).
22
 
23
+ ## Use (base LM)
24
+
25
+ This is a **base language model** (post-midtrain, **pre-SFT**) β€” use it for text continuation, not chat. EOS is the GPT-2 `<|endoftext|>` (`50256`). For a chat model, use the `d24-sft-*` checkpoints.
26
+
27
  ```python
28
  from transformers import AutoModelForCausalLM, AutoTokenizer
29
+ mid = "sfanm/d24-midtrain-v1base-mathheavy-3.7B"
30
+ tok = AutoTokenizer.from_pretrained(mid)
31
+ model = AutoModelForCausalLM.from_pretrained(mid, torch_dtype="bfloat16", device_map="auto")
32
+ inputs = tok("The derivative of x**2 is", return_tensors="pt").to(model.device)
33
+ print(tok.decode(model.generate(**inputs, max_new_tokens=128)[0], skip_special_tokens=True))
34
  ```
35
 
36
  *Research checkpoint from a from-scratch nanochat-d24 replication (pretrain β†’ midtrain β†’ SFT β†’ RL) on NERSC Perlmutter. Trained on third-party corpora (ClimbMix, FineMath, OpenMath, MetaMath, OpenThoughts, OLMo-3 Dolmino, SmolTalk, …) β€” see those datasets' licenses; provided as-is for research.*