Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Local Command-Line Chatbot using Hugging Face

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.


πŸš€ Features

  • πŸ’¬ 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

🧱 Project Structure

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

About

Cjatbot CLI - Task 1

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages