Downloads · 30 days
118
27% of all-time downloads
aradmanamnaoon/persian-lm-from-scratch
persian-lm-from-scratch is a text generation model from aradmanamnaoon. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as cc-by-sa-3.0.
A decoder-only transformer language model trained entirely from scratch on Persian Wikipedia text. No pretrained weights, no pretrained tokenizer, no distillation — the model, the tokenizer, and the training corpus we…
Downloads · 30 days
118
27% of all-time downloads
All-time downloads
430
Public
Parameters
135M
491 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors270 MB · 99%
From the Hugging Face model README
A decoder-only transformer language model trained entirely from scratch on Persian Wikipedia text. No pretrained weights, no pretrained tokenizer, no distillation — the model, the tokenizer, and the training corpus were all built for this project.
| Property | Value |
|---|---|
| Parameters | 110.4M |
| Architecture | Decoder-only transformer (GPT-style) |
| Layers | 12 |
| Hidden size | 768 |
| Attention heads | 12 |
| FFN size | 3072 |
| Context length | 1024 |
| Vocabulary | 32,000 (BPE, trained from scratch) |
| Positional encoding | Learned absolute |
| Normalization | Pre-LayerNorm |
| Activation | GELU |
| Weight tying | Yes |
| Precision | fp16 |
| Model | Test perplexity |
|---|---|
| Unigram (add-1) | 1590.26 |
| 5-gram (interpolated) | 171.60 |
| This model | 14.52 |
11.8x improvement over the 5-gram baseline. Best val loss: 2.6391. Test loss: 2.6756.
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"aradmanamnaoon/persian-lm-from-scratch",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(
"aradmanamnaoon/persian-lm-from-scratch",
trust_remote_code=True,
)
@misc{persian_gpt_110m, title = {Persian GPT - 110M parameters, trained from scratch}, author = {Arad Manamnaoon}, year = {2026}, url = {https://huggingface.co/aradmanamnaoon/persian-lm-from-scratch} }