Spaces:
Runtime error
Runtime error
A newer version of the Gradio SDK is available:
5.49.1
metadata
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
Usage
- Enter a story prompt (e.g., "Once upon a time, there was a...")
- Optionally adjust generation settings
- Click "Generate Story"
- Enjoy your AI-generated children's story!
Setup Instructions
To run this Space:
- Upload your trained model to HuggingFace Hub
- Update the
MODEL_REPOvariable inapp.pywith your model repository (format:username/model-name) - Or set the
MODEL_REPOenvironment variable in the Space settings
Local Development
pip install -r requirements.txt
python app.py
License
MIT License
Acknowledgments
- Model architecture and training code adapted from llama2.c by Andrej Karpathy
- Trained on the TinyStories dataset by Ronen Eldan and Yuanzhi Li
- Based on the Llama 2 architecture by Meta AI