Downloads · 30 days
13
9% of all-time downloads
yahya94812/Tiny-GPT
Tiny-GPT is a text generation model from yahya94812. Use it when you need the model to write or continue text. It is set up for transformers.
A small GPT-style decoder-only language model, trained from scratch on TinyStories.
Downloads · 30 days
13
9% of all-time downloads
All-time downloads
139
Public
Parameters
102M
815 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors408 MB · 100%
From the Hugging Face model README
A small GPT-style decoder-only language model, trained from scratch on TinyStories.
scaled_dot_product_attention, GELU MLP, pre-LayerNorm, tied input/output embeddings).vocab_size=128), i.e. id == ord(char).from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "yahya94812/Tiny-GPT"
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo_id, trust_remote_code=True)
inputs = tokenizer("Once upon a time", return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=200, do_sample=True, temperature=0.8)
print(tokenizer.decode(out[0]))
trust_remote_code=True is required because this model uses a custom architecture
(modeling_tinygpt.py) rather than one built into transformers.
This is a small research/educational model trained on TinyStories; it generates simple, short children's-story-style text and will not perform general-purpose language tasks.