Downloads · 30 days
3
2% of all-time downloads
luhres/toy-transformer-alice
toy-transformer-alice is a machine learning model from luhres. 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 tiny GPT-style decoder-only Transformer trained on Lewis Carroll's Alice's Adventures in Wonderland for the L5 Transformers lecture of a Master's-level Deep Learning and Generative AI course.
Downloads · 30 days
3
2% of all-time downloads
All-time downloads
174
Public
Repo size
5 MB
Likes
0
Public
Click a slice to open those files.
.npy2 MB · 78%
From the Hugging Face model README
A tiny GPT-style decoder-only Transformer trained on Lewis Carroll's Alice's Adventures in Wonderland for the L5 Transformers lecture of a Master's-level Deep Learning and Generative AI course.
| Hyperparameter | Value |
|---|---|
| d_model | 32 |
| n_heads | 4 |
| n_layers | 2 |
| d_ff | 128 |
| max_seq_len | 32 |
| vocabulary size | 2711 |
| trainable parameters | 111,904 |
| positional encoding | sinusoidal |
| residual placement | post-norm |
| output projection | tied to input embedding |
model.pt — PyTorch state dictvocab.json — token-to-id mapping (itos, stoi)config.json — architecture hyperparametersloss_curve.npy — training loss per stepfrom huggingface_hub import hf_hub_download
import torch, json
state_path = hf_hub_download('luhres/toy-transformer-alice', 'model.pt')
config_path = hf_hub_download('luhres/toy-transformer-alice', 'config.json')
vocab_path = hf_hub_download('luhres/toy-transformer-alice', 'vocab.json')
config = json.load(open(config_path))
vocab = json.load(open(vocab_path))
# instantiate ToyTransformer with config and call model.load_state_dict(torch.load(state_path))
Intended for educational use. Not suitable for any real-world application.