Views
No views yet
| Parameters | 353,502,208 |
| d_model | 1024 |
| Layers | 24 |
| Attention heads | 16 |
| KV heads | 16 (standard MHA, no GQA) |
| Position encoding | RoPE |
| Normalization | RMSNorm, Pre-LN |
| Feed-forward | SwiGLU (8/3 hidden multiplier) |
| Context length | 1024 |
| Vocab size | 50,304 (tiktoken GPT-2 BPE, padded) |
| Optimizer | AdamW |
| Tied embeddings | Yes |
modern-llm-v1-base, further trained via supervised fine-tuning. [describe your SFT dataset/setup here — e.g. dataset name, size, format]1from huggingface_hub import snapshot_download
2from safetensors.torch import load_file
3import sys
4
5local_dir = snapshot_download("JohnEnev/modern-llm-v1-sft")
6sys.path.insert(0, local_dir)
7
8from modeling.gpt import GPT, GPTConfig
9
10# NOTE: GPTConfig() defaults are shaped for V2 — override explicitly for V1.
11config = GPTConfig(
12 vocab_size=50304, d_model=1024, n_layers=24, n_heads=16, n_kv_heads=16,
13 max_seq_len=1024, use_flash=True, tie_weights=True,
14 use_qk_norm=False, use_diff_attn=False, use_mhc=False, use_xsa=False,
15)
16model = GPT(config)
17
18state_dict = load_file(f"{local_dir}/model.safetensors")
19model.load_state_dict(state_dict, strict=False) # lm_head re-tied below
20model.lm_head.weight = model.token_embeddings.weight
21model.eval()1import torch, tiktoken
2
3enc = tiktoken.get_encoding("gpt2")
4input_ids = torch.tensor([enc.encode("The meaning of life is")])
5output = model.generate(input_ids, max_new_tokens=50, temperature=0.8, top_k=50)
6print(enc.decode(output[0].tolist()))modern-llm-v1-base — the pretrained base model, for comparisonmodern-llm-v1-grpo — this model, further trained with GRPO