Downloads · 30 days
72
2% of all-time downloads
younissk/nanoBeard-sloop-14M
nanoBeard-sloop-14M is a text generation model from younissk. Use it when you need the model to write or continue text. It is set up for pytorch.
Downloads · 30 days
72
2% of all-time downloads
All-time downloads
3.5K
Public
Parameters
14.3M
125 MB on disk
Likes
8
Public
Click a slice to open those files.
.onnx68.1 MB · 54%
From the Hugging Face model README

A tiny pirate-themed GPT trained from scratch on a piratized version of TinyStories, then SFT-tuned. Built as a learning project — closer to nanoGPT than to a production LM.
| 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.This model is not a transformers model — it uses the custom GPT class
from this repo.
import json, torch
from huggingface_hub import hf_hub_download
from safetensors.torch import load_model
from tokenizers import Tokenizer
from training.config import Config
from training.model import GPT
repo = "younissk/nanoBeard"
cfg_path = hf_hub_download(repo, "config.json")
weights_path = hf_hub_download(repo, "model.safetensors")
tok_path = hf_hub_download(repo, "pirate_bpe.json")
cfg_dict = json.load(open(cfg_path))
cfg = Config(**{k: v for k, v in cfg_dict.items()
if k in Config.__dataclass_fields__})
model = GPT(cfg).eval()
load_model(model, weights_path)
tok = Tokenizer.from_file(tok_path)
ids = torch.tensor([tok.encode("Once upon a time").ids])
with torch.no_grad():
for _ in range(80):
logits, _ = model(ids[:, -cfg.block_size:])
next_id = torch.multinomial(torch.softmax(logits[:, -1] / 0.8, -1), 1)
ids = torch.cat([ids, next_id], dim=1)
print(tok.decode(ids[0].tolist()))
dataset/piratize.py script in this repo.