A lightweight, terminal-based chatbot powered by Hugging Face Transformers. This chatbot simulates realistic multi-turn conversations using short-term memory and runs entirely offline after the model is downloaded once. Built with modular, clean Python code β perfect for demos and developer-level interaction.
- π¬ Conversational AI using
microsoft/DialoGPT-small - π§ Maintains memory of the last 5 exchanges (sliding window)
- π₯οΈ CLI interface for fast and local user interaction
- π§© Clean modular code structure (
model_loader.py,chat_memory.py,interface.py) - βοΈ Fully local execution (no need for GPU or cloud)
DEMO VIDEO LINK ------> https://drive.google.com/file/d/1iEHIgIHnb_DMGrytEJTwfWwFEjNjYQ3l/view?usp=sharing
Chatbot-CLI/
β
βββ model_loader.py # Loads the model and tokenizer from Hugging Face
βββ chat_memory.py # Manages short-term memory for conversations
βββ interface.py # Command-line loop that runs the chatbot
βββ README.md # You're reading it!
βββ .gitignore # Excludes large model and cache files
βββ venv/ # Local virtual environment (not tracked by git)
π οΈ Setup Instructions
πΉ 1. Clone the repository
git clone https://github.com/yourusername/Chatbot-CLI.git
cd Chatbot-CLI
πΉ 2. Create and activate virtual environment
bash
python -m venv venv
# Activate:
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
πΉ 3. Install dependencies
pip install transformers torch
βΆοΈ Run the Chatbot
python interface.py
π¦ Requirements
Python 3.7 or higher
transformers (by Hugging Face)
torch (PyTorch backend)
π¨βπ» Tech Stack
π§ Model: microsoft/DialoGPT-small
π Language: Python 3
π¦ Libraries: transformers, torch, collections
π Acknowledgements
Model: DialoGPT by Microsoft
Task: Machine Learning Internship Assignment β Local CLI Chatbot
π¬ Contact
π linkedin.com/in/rohanstech
π§ knightofind@gmail.com
github.com/KnightofInd