Views
No views yet
| Key | Value |
|---|---|
| Decoder block | llama2 (RMSNorm + RoPE + SwiGLU, causal masking) |
| Hidden layers | 8 |
| Hidden size | 512 |
| Query heads | 4 (head_dim=128) |
| KV heads | 4 (MHA) |
| Intermediate (MLP) | 1376 (8/3 x 512, SwiGLU) |
| Vocab size | 32,000 (bundled Llama2 SentencePiece tokenizer) |
| Max position embeddings | 1024 |
| Tie word embeddings | false |
| Approx parameters | 58M |
src/maxtext/assets/tokenizers/tokenizer.llama2, vocab 32,000) is included
in this repo as tokenizer.model. Load with:1from transformers import LlamaTokenizer
2tok = LlamaTokenizer.from_pretrained("Cion-lab/tinystories-8L-llama3-block")1from transformers import AutoModelForCausalLM, LlamaTokenizer
2import torch
3
4REPO = "Cion-lab/tinystories-8L-llama3-block"
5m = AutoModelForCausalLM.from_pretrained(REPO, torch_dtype=torch.bfloat16)
6tok = LlamaTokenizer.from_pretrained(REPO)
7
8prompt = "Once upon a time, "
9ids = tok(prompt, return_tensors="pt").input_ids
10out = m.generate(ids, max_new_tokens=64, do_sample=True, temperature=0.8, top_p=0.9)
11print(tok.decode(out[0], skip_special_tokens=True))1@misc{tinystories,
2 title = {TinyStories},
3 author = {Eldan, Ronen and Li, Yuanzhi},
4 year = 2023,
5 howpublished = {https://huggingface.co/datasets/roneneldan/TinyStories}
6}
7
8@misc{maxtext,
9 title = {MaxText: A Simple, Performant and User-Friendly OpenSource LLM training Codebase},
10 author = {Google},
11 howpublished = {https://github.com/AI-Hypercomputer/maxtext}
12}