Skip to content

Fa-Abdullah/Terminal-Chatbot-using-BlenderBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Terminal Chatbot using BlenderBot

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.

Features

  • 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

Tech Stack

  • Python
  • Hugging Face Transformers
  • PyTorch
  • BlenderBot-400M-Distill

Project Structure

Chatbot_in_terminal/
│
├── chatbot.py
├── requirements.txt
└── README.md

Installation

Clone the repository:

git clone https://github.com/yourusername/Chatbot_in_terminal.git
cd Chatbot_in_terminal

Install the dependencies:

pip install transformers torch sentencepiece

Usage

Example:

> 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.

How It Works

  1. Loads the BlenderBot-400M-Distill model.
  2. Loads the corresponding tokenizer.
  3. Maintains conversation history.
  4. Encodes both the history and the new user message.
  5. Generates a response using the language model.
  6. Decodes and prints the generated response.
  7. Repeats until the program is terminated.

Model

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.

About

Terminal-based conversational AI chatbot powered by Facebook BlenderBot-400M-Distill and Hugging Face Transformers.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages