CodeDevX commited on
Commit
9b28709
·
verified ·
1 Parent(s): 7b8590c

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +51 -0
README.md ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 5M Text Generator
2
+
3
+ A small 5M parameter text generation model trained on educational/scientific text data.
4
+
5
+ ## Model Details
6
+
7
+ - **Parameters**: 4,983,808 (4.98M)
8
+ - **Architecture**: Transformer Decoder with GQA, RoPE, SwiGLU
9
+ - **Training**: 1000 steps on 5000 text samples
10
+ - **Vocabulary**: 8000 tokens (BPE)
11
+
12
+ ## Usage
13
+
14
+ ```python
15
+ from transformers import PreTrainedTokenizerFast
16
+ import torch
17
+ import sys
18
+ sys.path.insert(0, ".") # if needed
19
+
20
+ from model import TextDecoder
21
+
22
+ # Load model
23
+ model = TextDecoder.from_pretrained("CodeDevX/5m-text-generator")
24
+ tokenizer = PreTrainedTokenizerFast.from_pretrained("CodeDevX/5m-text-generator")
25
+
26
+ # Generate text
27
+ input_ids = tokenizer("The quick brown fox", return_tensors="pt").input_ids
28
+ output = model.generate(input_ids, max_new_tokens=50, temperature=0.8)
29
+ print(tokenizer.decode(output[0]))
30
+ ```
31
+
32
+ ## Architecture
33
+
34
+ - Hidden size: 256
35
+ - Layers: 6
36
+ - Attention heads: 8 (KV heads: 2)
37
+ - Intermediate size: 768
38
+ - Max sequence length: 512
39
+
40
+ ## Training Results
41
+
42
+ | Step | Loss |
43
+ |------|------|
44
+ | 100 | 12.68 |
45
+ | 200 | 2.17 |
46
+ | 500 | 0.15 |
47
+ | 1000 | 0.13 |
48
+
49
+ ## License
50
+
51
+ MIT