Pablinho/bedtime-stories
1
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.txtUsage
- 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
assetsfolder with example images, are included in your repository. - Set the Space SDK to "Gradio".
- The
requirements.txtfile should automatically install all necessary dependencies.
Project Structure
app.py: Main application file with Gradio interfacebrain.py: Contains theStoryGeneratorclass 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.
