|
|
--- |
|
|
language: |
|
|
- en |
|
|
tags: |
|
|
- gpt2 |
|
|
- text-generation |
|
|
- story-generation |
|
|
- creative-writing |
|
|
- TinyStories |
|
|
- ai-story |
|
|
license: mit |
|
|
datasets: |
|
|
- roneneldan/TinyStories |
|
|
metrics: |
|
|
- perplexity |
|
|
model-index: |
|
|
- name: tiny-stories-gpt2 |
|
|
results: [] |
|
|
--- |
|
|
|
|
|
# 🧚♀️ Tiny Stories GPT-2 |
|
|
**Author:** [Fathi7ma](https://huggingface.co/Fathi7ma) |
|
|
**Model type:** Fine-tuned GPT-2 for creative story generation |
|
|
**Dataset:** [roneneldan/TinyStories](https://huggingface.co/datasets/roneneldan/TinyStories) |
|
|
|
|
|
--- |
|
|
|
|
|
## 🧠 Model Overview |
|
|
This model is a fine-tuned version of **GPT-2 (small)** trained on the [TinyStories](https://huggingface.co/datasets/roneneldan/TinyStories) dataset — a large collection of short, simple stories for children. |
|
|
The goal of this project is to create a lightweight, fun, and creative **story generator** that can produce short, imaginative stories from user prompts. |
|
|
|
|
|
--- |
|
|
|
|
|
## ✨ Intended Use |
|
|
Use this model for: |
|
|
- Generating **short, creative stories** |
|
|
- Educational or entertainment purposes |
|
|
- Quick writing inspiration or kids’ content |
|
|
|
|
|
Example use: |
|
|
```python |
|
|
from transformers import pipeline |
|
|
generator = pipeline("text-generation", model="Fathi7ma/tiny-stories-gpt2") |
|
|
prompt = "A tiny robot who wanted to fly" |
|
|
print(generator(prompt, max_length=80, num_return_sequences=1)[0]["generated_text"]) |
|
|
|
|
|
|
|
|
### Training hyperparameters |
|
|
|
|
|
The following hyperparameters were used during training: |
|
|
- learning_rate: 5e-05 |
|
|
- train_batch_size: 8 |
|
|
- eval_batch_size: 8 |
|
|
- seed: 42 |
|
|
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments |
|
|
- lr_scheduler_type: linear |
|
|
- num_epochs: 3 |
|
|
- mixed_precision_training: Native AMP |
|
|
|
|
|
### Training results |
|
|
|
|
|
| Training Loss | Epoch | Step | Validation Loss | |
|
|
|:-------------:|:-----:|:----:|:---------------:| |
|
|
| 1.9127 | 1.0 | 2375 | 1.7789 | |
|
|
| 1.7876 | 2.0 | 4750 | 1.7186 | |
|
|
| 1.6976 | 3.0 | 7125 | 1.6995 | |
|
|
|
|
|
|
|
|
### Framework versions |
|
|
|
|
|
- Transformers 4.57.1 |
|
|
- Pytorch 2.8.0+cu126 |
|
|
- Datasets 4.0.0 |
|
|
- Tokenizers 0.22.1 |
|
|
|