omm / convo.py
Nikhil0987's picture
Update convo.py
8c396bc
raw history blame
No virus
695 Bytes
from transformers import pipeline, Conversation
import streamlit as st
from streamlit_option_menu import option_menu
chatbot = pipeline(task="conversational", model="microsoft/DialoGPT-medium")
def Convo():
if convo := st.chat_input("Enter your message"):
conversation = Conversation(convo)
# candidate_labels = ["HELP", "PROBLEM SOLVE", "GENERAL TALK"]
ans = chatbot(conversation)
# add_user_input = st.button("Add User Input")
# conversation.add_user_input("{}".format(convo))
# conversation = chatbot(conversation)
with st.chat_message("assistant"):
# ans
st.write(ans.generated_responses[-1])
# convo()