CoolFace
Apppublic

sdobson/tinystories-llama-15m

sourceHugging Facemitupdated 11mo agoView on Hugging Face
0likes
App README

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

  1. 1.Enter a story prompt (e.g., "Once upon a time, there was a...")
  2. 2.Optionally adjust generation settings
  3. 3.Click "Generate Story"
  4. 4.Enjoy your AI-generated children's story!

Setup Instructions

To run this Space:

  1. 1.Upload your trained model to HuggingFace Hub
  2. 2.Update the MODEL_REPO variable in app.py with your model repository (format: username/model-name)
  3. 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 by Andrej Karpathy
  • Trained on the TinyStories dataset by Ronen Eldan and Yuanzhi Li
  • Based on the Llama 2 architecture by Meta AI