GautierP commited on
Commit
b06def8
·
verified ·
1 Parent(s): eed943d

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +10 -10
README.md CHANGED
@@ -12,11 +12,11 @@ tags:
12
 
13
  A ~40M parameter conversational assistant with a full training pipeline implemented
14
  end-to-end in PyTorch — BPE tokenizer, pretraining and supervised fine-tuning, no
15
- pretrained backbone. Part of the
16
- [Mini-LLM](https://github.com/Mini-llm-lab/Mini-LLM) project.
17
 
18
- This repository hosts both the SFT assistant (repository root) and the base model it
19
- was fine-tuned from ([`base/`](base)).
20
 
21
  ## Model details
22
 
@@ -24,7 +24,7 @@ was fine-tuned from ([`base/`](base)).
24
  | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
25
  | Parameters | 42,476,032 (input embedding shared with the output head) |
26
  | Architecture | Transformer decoder: RMSNorm, RoPE, causal attention, SwiGLU |
27
- | Context length | 1,024 tokens — twice the 512 of the older 34M/70M/150M family runs |
28
  | Vocabulary | 32,768 (BPE) |
29
  | Pretraining | ~4.60B tokens (FineWeb-Edu + Wikipedia), 35,096 steps (~115 tokens/param) — base val loss 3.202 |
30
  | Fine-tuning | 2 epochs of SFT on Dolly-15k, No Robots, OpenAssistant oasst2, alpaca-cleaned and identity/small-talk examples — val loss 3.058 |
@@ -32,18 +32,18 @@ was fine-tuned from ([`base/`](base)).
32
 
33
  ## Base model
34
 
35
- The [`base/`](base) subfolder contains the pretrained checkpoint
36
  (`mini-llm-base-40M-35096steps.pt`) before SFT: 42,476,032 parameters, 32,768-token
37
  BPE vocabulary, ~4.60B tokens (FineWeb-Edu + Wikipedia), 35,096 steps — base val loss
38
- 3.202. It is a raw completion model, not an assistant: `base/` ships without a chat
39
  template and without the assistant's sampling defaults.
40
 
41
  ```python
42
  from transformers import AutoModelForCausalLM, AutoTokenizer
43
 
44
- repo = "GautierP/MiniLLM-40M"
45
- tok = AutoTokenizer.from_pretrained(repo, subfolder="base", trust_remote_code=True)
46
- model = AutoModelForCausalLM.from_pretrained(repo, subfolder="base", trust_remote_code=True)
47
 
48
  inputs = tok("The capital of France is", return_tensors="pt")
49
  out = model.generate(**inputs, max_new_tokens=64, do_sample=True, temperature=0.8, top_k=50)
 
12
 
13
  A ~40M parameter conversational assistant with a full training pipeline implemented
14
  end-to-end in PyTorch — BPE tokenizer, pretraining and supervised fine-tuning, no
15
+ pretrained backbone. Code, training pipeline and documentation:
16
+ [github.com/Mini-llm-lab/Mini-LLM](https://github.com/Mini-llm-lab/Mini-LLM).
17
 
18
+ This repository hosts the SFT assistant. The base model it was fine-tuned from is
19
+ published separately: [GautierP/MiniLLM-40M-base](https://huggingface.co/GautierP/MiniLLM-40M-base).
20
 
21
  ## Model details
22
 
 
24
  | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
25
  | Parameters | 42,476,032 (input embedding shared with the output head) |
26
  | Architecture | Transformer decoder: RMSNorm, RoPE, causal attention, SwiGLU |
27
+ | Context length | 1,024 tokens — twice the 512 of the earlier 1.0-generation runs |
28
  | Vocabulary | 32,768 (BPE) |
29
  | Pretraining | ~4.60B tokens (FineWeb-Edu + Wikipedia), 35,096 steps (~115 tokens/param) — base val loss 3.202 |
30
  | Fine-tuning | 2 epochs of SFT on Dolly-15k, No Robots, OpenAssistant oasst2, alpaca-cleaned and identity/small-talk examples — val loss 3.058 |
 
32
 
33
  ## Base model
34
 
35
+ The base repository contains the pretrained checkpoint
36
  (`mini-llm-base-40M-35096steps.pt`) before SFT: 42,476,032 parameters, 32,768-token
37
  BPE vocabulary, ~4.60B tokens (FineWeb-Edu + Wikipedia), 35,096 steps — base val loss
38
+ 3.202. It is a raw completion model, not an assistant: the base ships without a chat
39
  template and without the assistant's sampling defaults.
40
 
41
  ```python
42
  from transformers import AutoModelForCausalLM, AutoTokenizer
43
 
44
+ repo = "GautierP/MiniLLM-40M-base"
45
+ tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
46
+ model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True)
47
 
48
  inputs = tok("The capital of France is", return_tensors="pt")
49
  out = model.generate(**inputs, max_new_tokens=64, do_sample=True, temperature=0.8, top_k=50)