Spaces:
Runtime error
Runtime error
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 | |
1. Clone this repository: | |
``` | |
git clone https://github.com/yourusername/kids-story-generator.git | |
cd kids-story-generator | |
``` | |
2. Install the required dependencies: | |
``` | |
pip install -r requirements.txt | |
``` | |
## Usage | |
1. Run the application: | |
``` | |
python app.py | |
``` | |
2. Open your web browser and navigate to the URL provided in the terminal (usually `http://localhost:7860`). | |
3. Upload an image or use one of the provided examples. | |
4. Select a language model from the dropdown menu. | |
5. 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: | |
1. Create a new Space on Hugging Face. | |
2. Connect your GitHub repository to the Space. | |
3. Make sure all files, including the `assets` folder with example images, are included in your repository. | |
4. Set the Space SDK to "Gradio". | |
5. The `requirements.txt` file should automatically install all necessary dependencies. | |
## Project Structure | |
- `app.py`: Main application file with Gradio interface | |
- `brain.py`: Contains the `StoryGenerator` class with core functionality | |
- `assets/`: Folder containing example images | |
- `requirements.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](LICENSE) file for details. | |