This project is a simple text generation chatbot web application built with Streamlit that utilizes the GPT-2 model for text generation. Users can input a text prompt and receive generated text based on their input.
- Streamlit - A framework for building web applications in Python.
- Transformers - A library for state-of-the-art natural language processing.
To run this application locally, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/text-generation-bot.git cd text-generation-bot -
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows
venv\Scripts\activate
- On Linux/MacOS
source venv/bin/activate
-
Install the required packages:
pip install streamlit transformers
-
Run the application:
streamlit run app.py
-
Open your web browser and go to http://localhost:8501 to access the app.
- Enter your text prompt in the provided text area. For example:
As the sun set over the horizon, the explorers gathered around the campfire and shared tales of their latest adventure. One of them said,-
Click the "Generate Text" button.
-
The generated text will be displayed below the button.

