Spaces:
Runtime error
A newer version of the Gradio SDK is available:
5.7.0
title: Bedtime Stories
emoji: 🧙🏼♂️
colorFrom: gray
colorTo: blue
sdk: gradio
sdk_version: 4.39.0
app_file: app.py
pinned: false
Bedtime Stories Generator
This project is an AI-powered Children Story Generator that creates unique stories based on uploaded images. It uses image captioning and large language models to generate engaging stories for children.
Features
- Upload an image to generate a story
- Choose from multiple language models for story generation
- User interface built with Gradio
- Handles various image formats
Tech Stack
- Python
- Gradio for the web interface
- Hugging Face Transformers for image captioning
- LangChain for interfacing with language models
- PIL (Python Imaging Library) for image processing
Installation
Clone this repository:
git clone https://github.com/yourusername/kids-story-generator.git cd kids-story-generator
Install the required dependencies:
pip install -r requirements.txt
Usage
Run the application:
python app.py
Open your web browser and navigate to the URL provided in the terminal (usually
http://localhost:7860
).Upload an image or use one of the provided examples.
Select a language model from the dropdown menu.
Click "Submit" to generate a story based on the image.
Deploying to Hugging Face Spaces
This project is designed to be easily deployed to Hugging Face Spaces. To deploy:
- Create a new Space on Hugging Face.
- Connect your GitHub repository to the Space.
- Make sure all files, including the
assets
folder with example images, are included in your repository. - Set the Space SDK to "Gradio".
- The
requirements.txt
file should automatically install all necessary dependencies.
Project Structure
app.py
: Main application file with Gradio interfacebrain.py
: Contains theStoryGenerator
class with core functionalityassets/
: Folder containing example imagesrequirements.txt
: List of Python dependencies
Contributing
Contributions to improve the project are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.