Views
No views yet
| Component | Choice | Why |
|---|---|---|
| Position Encoding | RoPE | Used in LLaMA, Mistral, Gemma — better length generalization |
| Activation | SwiGLU | Used in LLaMA, PaLM — better gradient flow than GeLU |
| Normalization | RMSNorm | Used in LLaMA — faster than LayerNorm |
| Attention | Flash Attention (PyTorch 2.0+) | Memory efficient causal attention |
1import torch
2import tiktoken
3from huggingface_hub import hf_hub_download
4
5# Load weights
6weights_path = hf_hub_download(repo_id="Manushi0304/tinystories-slm-rope", filename="pytorch_model.bin")
7# Load config and rebuild model, then load state dict