Downloads · 30 days
63
80% of all-time downloads
kryln/tinystories-minigpt
tinystories-minigpt is a machine learning model from kryln. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
A ~5M parameter character-level GPT model trained from scratch on TinyStories.
Downloads · 30 days
63
80% of all-time downloads
All-time downloads
79
Public
Parameters
4.9M
19.6 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors19.6 MB · 100%
From the Hugging Face model README
A ~5M parameter character-level GPT model trained from scratch on TinyStories.
| Parameter | Value |
|---|---|
| Parameters | ~4.9M |
| Vocab Size | 72 (character-level) |
| Embedding Dim | 256 |
| Layers | 6 |
| Attention Heads | 8 |
| Context Length | 128 |
| Training Steps | 3,000 |
| Final Val Loss | 0.9235 |
Standard mini-GPT architecture:
Trained on CPU for ~1 hour 17 minutes on the TinyStories dataset.
import torch
from train_torch import MiniGPT
# Load model
model = MiniGPT(vocab_size=72, n_embd=256, n_head=8, n_layer=6, block_size=128, dropout=0.1)
model.load_state_dict(torch.load("model.safetensors"))
model.eval()
# Generate
context = torch.zeros((1, 1), dtype=torch.long)
output = model.generate(context, max_new_tokens=200, temperature=0.7)
He saw a bike with a big box. He was a girl named Sue. Sue liked to give it very happy. One day, she got to the little boy named Tim. Tim was very happy. He wind the best friends was friends. The tree...
MIT