Sam Dobson
First commit
c514928
---
title: TinyStories Story Generator
emoji: πŸ“š
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit
tags:
- text-generation
- llama
- tinystories
- storytelling
---
# TinyStories Story Generator
An interactive Gradio Space for generating simple children's stories using a small Llama-architecture model trained on the TinyStories dataset.
## About
This Space provides a chat-style interface to interact with a ~15M parameter language model that generates simple, coherent children's stories. The model uses vocabulary and concepts that a typical 3-4 year old would understand.
## Features
- Interactive story generation
- Adjustable generation parameters (temperature, top-k, top-p, max length)
- Example prompts to get started
- Real-time generation
- Clean, user-friendly interface
## Model Details
- **Architecture:** Llama 2
- **Parameters:** ~15M
- **Layers:** 6
- **Attention Heads:** 6
- **Max Context Length:** 256 tokens
- **Training Dataset:** [TinyStories](https://huggingface.co/datasets/roneneldan/TinyStories)
## Usage
1. Enter a story prompt (e.g., "Once upon a time, there was a...")
2. Optionally adjust generation settings
3. Click "Generate Story"
4. Enjoy your AI-generated children's story!
## Setup Instructions
To run this Space:
1. Upload your trained model to HuggingFace Hub
2. Update the `MODEL_REPO` variable in `app.py` with your model repository (format: `username/model-name`)
3. Or set the `MODEL_REPO` environment variable in the Space settings
## Local Development
```bash
pip install -r requirements.txt
python app.py
```
## License
MIT License
## Acknowledgments
- Model architecture and training code adapted from [llama2.c](https://github.com/karpathy/llama2.c) by Andrej Karpathy
- Trained on the [TinyStories dataset](https://huggingface.co/datasets/roneneldan/TinyStories) by Ronen Eldan and Yuanzhi Li
- Based on the Llama 2 architecture by Meta AI