This chatbot application is built using Flask and the DialoGPT model from the transformers
library. It provides a simple web interface where users can interact with the chatbot.
- Web-based interface for user interaction.
- Utilizes the medium-sized DialoGPT model from Microsoft for generating responses.
- Real-time chat experience.
-
Clone the Repository:
git clone https://github.com/abubakar-sani/flask_chatbot_project cd flask_chatbot_project
-
Install Dependencies: Ensure you have Python and pip installed. Then, install the required packages:
pip install flask transformers
-
Run the Application:
python cb2.py
This will start the Flask server, and the application will be accessible at
http://127.0.0.1:5000/
.
- Open a web browser and navigate to
http://127.0.0.1:5000/
. - Enter your message in the input field and click "Send" or press Enter.
- The chatbot will generate a response, which will be displayed on the page.
- You can switch to a different model by changing the
model_name
variable. Ensure the model is compatible with theAutoModelForCausalLM
class from thetransformers
library. - Adjust the
max_length
parameter in thechatbot
function to generate longer or shorter responses.
This project is open-source and available under the MIT License.