singhpratech commited on
Commit
00fbfe5
·
verified ·
1 Parent(s): 26c4ae4

Upload folder using huggingface_hub

Browse files
Files changed (5) hide show
  1. README.md +18 -0
  2. config.json +8 -0
  3. model.pt +3 -0
  4. tokenizer.json +0 -0
  5. tokenizer_config.json +8 -0
README.md ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language: en
4
+ datasets: [roneneldan/TinyStories]
5
+ tags: [tiny, from-scratch, pytorch, educational, text-generation]
6
+ ---
7
+ # Tiny Storyteller
8
+
9
+ A 5.9M-parameter GPT-style language model trained **from scratch** (random init, no pretrained weights)
10
+ on 20,000 TinyStories, as a learning project. Use case: a bedtime story starter for young kids.
11
+
12
+ - Architecture: 6 transformer blocks, 4 heads, 256-dim embeddings, 256-token context
13
+ - Tokenizer: byte-level BPE, 4,096 tokens, trained on the same data
14
+ - Training: 1500 steps, batch 32, AdamW, cosine schedule
15
+ - Final validation loss 2.185 (perplexity 8.9)
16
+
17
+ The full build, explained step by step, is in `tiny_llm_from_scratch.ipynb` in this repo.
18
+ Load with plain PyTorch: `GPT(cfg).load_state_dict(torch.load("model.pt"))`.
config.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "vocab_size": 4096,
3
+ "block_size": 256,
4
+ "n_embd": 256,
5
+ "n_head": 4,
6
+ "n_layer": 6,
7
+ "dropout": 0.0
8
+ }
model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:514b81b866785efaf42512b1ab7e368384987b90ec4eb83351c59d8a96a5f532
3
+ size 23434075
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|endoftext|>",
4
+ "eos_token": "<|endoftext|>",
5
+ "model_max_length": 1000000000000000019884624838656,
6
+ "pad_token": "<|endoftext|>",
7
+ "tokenizer_class": "TokenizersBackend"
8
+ }