A simple terminal-based conversational AI chatbot built with Hugging Face Transformers and Facebook BlenderBot-400M-Distill. The chatbot maintains conversation history to generate more context-aware responses directly from the command line.
- Interactive terminal chatbot
- Context-aware conversations using chat history
- Powered by Facebook BlenderBot-400M-Distill
- Built with Hugging Face Transformers
- Lightweight and easy to run
- Python
- Hugging Face Transformers
- PyTorch
- BlenderBot-400M-Distill
Chatbot_in_terminal/
│
├── chatbot.py
├── requirements.txt
└── README.md
Clone the repository:
git clone https://github.com/yourusername/Chatbot_in_terminal.git
cd Chatbot_in_terminalInstall the dependencies:
pip install transformers torch sentencepieceExample:
> Hello
Hi! How are you today?
> Tell me a joke.
Why don't scientists trust atoms? Because they make up everything!
Type your messages continuously. The chatbot stores the conversation history during the session to generate more coherent responses.
- Loads the BlenderBot-400M-Distill model.
- Loads the corresponding tokenizer.
- Maintains conversation history.
- Encodes both the history and the new user message.
- Generates a response using the language model.
- Decodes and prints the generated response.
- Repeats until the program is terminated.
The project uses:
- facebook/blenderbot-400M-distill
This conversational model is optimized for open-domain dialogue while remaining lightweight enough to run on consumer hardware.