Creatify Stories is a Flask application that uses AI to generate short stories based on user inputs. The primary goal of the application is to allow users to creatively express ideas by providing a prompt, which the AI then expands into a narrative. This project showcases how artificial intelligence can be integrated into web applications to enhance user creativity and engagement.
- User-Friendly Interface: The application has a clean and intuitive UI built with Bootstrap, making it accessible for all users.
- Text Generation: Utilizes the GPT-2 model from Hugging Face's Transformers library to generate coherent stories based on user prompts.
- Loading Animation: Displays a loading spinner while the story is being generated, improving user experience during processing delays.
- Responsive Design: The application is responsive and works seamlessly on various devices.
Story_Generation_Recording.mp4
- Frontend: HTML, CSS (Bootstrap), JavaScript
- Backend: Flask (Python)
- AI Model: GPT-2 from Hugging Face Transformers
Follow these steps to set up the project locally:
- Clone the Repository:
git clone https://github.com/theiturhs/Story-Generation-using-GPT2.git
cd Story-Generation-using-GPT2
- Create a Virtual Environment (optional but recommended)
python -m venv venv
venv\Scripts\activate
- Run the Application:
python App.py
- Access the Application:
Open your web browser and go to http://127.0.0.1:8000.
- Input a prompt in the provided text area. For example: "I was wondering what if I..."
- Click the "Create Story" button.
- Wait for the AI to generate a story (the loading spinner will indicate that the process is ongoing).
- Once generated, the story will be displayed below the input form.
- Flask Backend: The backend is powered by Flask, which handles HTTP requests and renders HTML templates.
- generate_story function: Processes the user input and generates a story using the generate_text function from the textGenerationCode module.
- Text Generation: The generate_text function uses the Hugging Face Transformers pipeline to generate text based on the user's prompt.
- HTML Template: The front end is styled using Bootstrap for a modern and responsive design. It includes a form for user input and a section to display the generated story.
For any inquiries or feedback, feel free to reach out: