A simple, terminal-based chatbot built with Python and Hugging Face's transformers library. This project serves as an introduction to how transformer models generate dialogue using a sequence-to-sequence approach.
- Lightweight Model: Uses
facebook/blenderbot-400M-distill. - Manual History Tracking: Demonstrates how to store and pass conversation context manually.
- CPU Optimized: Runs smoothly on any modern CPU.
- Clone:
git clone https://github.com/metalmancode/basic_chatbot.git - Environment:
python3 -m venv my_env source my_env/bin/activate pip install transformers torch numpy - Run:
python chatbot.py
- How tokenization works.
- How to load pre-trained models from Hugging Face.
- How to maintain a manual conversation history list.
For the advanced version with a Web UI and Modern LLM, see Basic_Chatbot_Upgraded.