A Python based chatbot implemented in Google Colab using the HuggingFace Transformers library. This chatbot supports conversational responses, context retention, and can operate entirely for free using an open source model.
This project demonstrates how to build a moderately advanced generative chatbot without needing paid APIs. It is suitable for academic assignments, demonstrations, and beginner level AI development projects.
- Fully free to use.
- Runs directly in Google Colab with no installations beyond standard pip packages.
- Uses an open source language model from HuggingFace.
- Supports multi turn conversation.
- Designed as a simple interactive CLI chatbot.
- Ready to be published on GitHub for public access.
- Python 3
- HuggingFace Transformers
- Google Colab
- GitHub for hosting
/project-root
chatbot.py
README.md
If using GitHub, click Code and download ZIP or use
git clone <your-repository-link>
- Open Colab
- Click File
- Click Upload Notebook or start a new notebook
- Upload chatbot.py using the left side Files panel if needed
Run this in a Colab cell
!pip install transformersfrom chatbot import chatbot_loop
chatbot_loop()The chatbot will start responding to user inputs interactively.
The core logic for the chatbot resides in chatbot.py.
The model used is
microsoft/DialoGPT-medium
The script maintains conversation history and generates responses based on previous turns. The system loops until the user types exit.
You: hello
Bot: Hi there. How can I help you today
You: tell me something interesting
Bot: Did you know that the deepest point on Earth is the Mariana Trench
This chatbot can be used for
- Artificial Intelligence coursework
- Chatbot development assignments
- NLP demonstrations
- Basic conversational model implementation
- This model runs locally in Colab.
- No API key is required.
- HuggingFace models may take a few seconds to load.