| import streamlit as st | |
| import os | |
| from transformers import pipeline, Conversation | |
| convo = pipeline(model="facebook/blenderbot-400M-distill") | |
| def chatbot(): | |
| st.title("ChatBot") | |
| if message := st.chat_input("Enter your query"): | |
| umsg = Conversation(message) | |
| answer = convo(umsg) | |
| with st.chat_message("Assistant"): | |
| st.write(answer) | |