Views
No views yet

| Field | Value |
|---|---|
| Architecture | Decoder-only Transformer (GPT-style) |
| Parameters | ~13.9M (approx) |
| Layers | 6 |
| Heads | 6 |
| Embedding dim | 384 |
| Context length | 256 tokens |
| Vocab size | 8192 (custom BPE) |
| Bias in Linear/LN | False |
| Tokenizer | pirate_bpe.json (HuggingFace tokenizers BPE) |
sft, iters=1400, val_loss=4.2816 (best 4.2485).cuda in bfloat16.model.safetensors — model weights.config.json — architecture config (load into training.config.Config).pirate_bpe.json — tokenizer (load with tokenizers.Tokenizer.from_file).training_metadata.json — full training config + metrics snapshot.banner.png — the banner above.transformers model — it uses the custom GPT class
from this repo.1import json, torch
2from huggingface_hub import hf_hub_download
3from safetensors.torch import load_model
4from tokenizers import Tokenizer
5
6from training.config import Config
7from training.model import GPT
8
9repo = "younissk/nanoBeard"
10cfg_path = hf_hub_download(repo, "config.json")
11weights_path = hf_hub_download(repo, "model.safetensors")
12tok_path = hf_hub_download(repo, "pirate_bpe.json")
13
14cfg_dict = json.load(open(cfg_path))
15cfg = Config(**{k: v for k, v in cfg_dict.items()
16 if k in Config.__dataclass_fields__})
17model = GPT(cfg).eval()
18load_model(model, weights_path)
19
20tok = Tokenizer.from_file(tok_path)
21ids = torch.tensor([tok.encode("Once upon a time").ids])
22with torch.no_grad():
23 for _ in range(80):
24 logits, _ = model(ids[:, -cfg.block_size:])
25 next_id = torch.multinomial(torch.softmax(logits[:, -1] / 0.8, -1), 1)
26 ids = torch.cat([ids, next_id], dim=1)
27print(tok.decode(ids[0].tolist()))dataset/piratize.py script in this repo.