Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,4 +9,75 @@ app_file: app.py
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Bedtime Stories Generator
|
| 13 |
+
|
| 14 |
+
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.
|
| 15 |
+
|
| 16 |
+
## Features
|
| 17 |
+
|
| 18 |
+
- Upload an image to generate a story
|
| 19 |
+
- Choose from multiple language models for story generation
|
| 20 |
+
- User interface built with Gradio
|
| 21 |
+
- Handles various image formats
|
| 22 |
+
|
| 23 |
+
## Tech Stack
|
| 24 |
+
|
| 25 |
+
- Python
|
| 26 |
+
- Gradio for the web interface
|
| 27 |
+
- Hugging Face Transformers for image captioning
|
| 28 |
+
- LangChain for interfacing with language models
|
| 29 |
+
- PIL (Python Imaging Library) for image processing
|
| 30 |
+
|
| 31 |
+
## Installation
|
| 32 |
+
|
| 33 |
+
1. Clone this repository:
|
| 34 |
+
```
|
| 35 |
+
git clone https://github.com/yourusername/kids-story-generator.git
|
| 36 |
+
cd kids-story-generator
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
2. Install the required dependencies:
|
| 40 |
+
```
|
| 41 |
+
pip install -r requirements.txt
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
## Usage
|
| 45 |
+
|
| 46 |
+
1. Run the application:
|
| 47 |
+
```
|
| 48 |
+
python app.py
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
2. Open your web browser and navigate to the URL provided in the terminal (usually `http://localhost:7860`).
|
| 52 |
+
|
| 53 |
+
3. Upload an image or use one of the provided examples.
|
| 54 |
+
|
| 55 |
+
4. Select a language model from the dropdown menu.
|
| 56 |
+
|
| 57 |
+
5. Click "Submit" to generate a story based on the image.
|
| 58 |
+
|
| 59 |
+
## Deploying to Hugging Face Spaces
|
| 60 |
+
|
| 61 |
+
This project is designed to be easily deployed to Hugging Face Spaces. To deploy:
|
| 62 |
+
|
| 63 |
+
1. Create a new Space on Hugging Face.
|
| 64 |
+
2. Connect your GitHub repository to the Space.
|
| 65 |
+
3. Make sure all files, including the `assets` folder with example images, are included in your repository.
|
| 66 |
+
4. Set the Space SDK to "Gradio".
|
| 67 |
+
5. The `requirements.txt` file should automatically install all necessary dependencies.
|
| 68 |
+
|
| 69 |
+
## Project Structure
|
| 70 |
+
|
| 71 |
+
- `app.py`: Main application file with Gradio interface
|
| 72 |
+
- `brain.py`: Contains the `StoryGenerator` class with core functionality
|
| 73 |
+
- `assets/`: Folder containing example images
|
| 74 |
+
- `requirements.txt`: List of Python dependencies
|
| 75 |
+
|
| 76 |
+
## Contributing
|
| 77 |
+
|
| 78 |
+
Contributions to improve the project are welcome! Please feel free to submit a Pull Request.
|
| 79 |
+
|
| 80 |
+
## License
|
| 81 |
+
|
| 82 |
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
| 83 |
+
|