IrfanGPT is an interactive web chat application powered by the Hugging Face Transformers library. It utilizes the Streamlit library to create a user-friendly interface for interacting with the chatbot.
Offers an interactive chat interface for user interaction Leverages Hugging Face's BlenderBot model for generating responses Maintains conversation history to provide a more engaging user experience
Python (version 3.7 or higher) Streamlit library Transformers library from Hugging Face
Create and Activate a Virtual Environment: Bash python -m venv venv source venv/bin/activate # On Windows use venv\Scripts\activate
Install Required Libraries: Bash pip install streamlit transformers
Run the following command in your terminal to start the local Streamlit server and access IrfanGPT in your web browser:
Bash streamlit run app.py
This will open http://localhost:8501 where you can interact with the chatbot through a text input box and a "Chat" button.
Imports necessary libraries Loads the BlenderBot model from Hugging Face Defines the render_ui function for: Creating the Streamlit UI with chat input and button Handling user interactions Manages conversation history using st.session_state Generates responses and handles errors
Upon starting the application, you'll see a text input box and a "Chat" button. Simply type your message and click "Chat" to start conversing with IrfanGPT. The conversation history and chatbot responses will be displayed on the page.
Hugging Face for providing the Transformers library and BlenderBot model Streamlit for the easy-to-use web application framework