Spaces:
Sleeping
Sleeping
this
Browse files9 unmodified lines101112131415161715 unmodified lines333435363738392 unmodified lines424344454647489 unmodified linesclassifyr = pipeline("zero-shot-classification")convo = pipeline("conversational")uri = os.environ["MONGO_CONNECTION_STRING"]client = MongoClient(uri, tlsCertificateKeyFile="database/cert.pem")15 unmodified linesdef Chatbot():st.title("Chatbot")if query :=st.chat_input("Enter your message"):ans = classifyr(query,candidate_labels=["reminders", "general conversation"])if ans["labels"][0] == "reminders":values = getValues(query.lower())with st.chat_message("assistant"):2 unmodified lineselif ans["labels"][0] == "general conversation":umsg = bard.get_answer(message)["content"]with st.chat_message("assistant"):st.write(umsg)9 unmodified lines10111213141516171815 unmodified lines343536373839402 unmodified lines434445464748499 unmodified lines# classifyr = pipeline("zero-shot-classification")# convo = pipeline("conversational")classifi = pipeline(model="facebook/bart-large-mnli")uri = os.environ["MONGO_CONNECTION_STRING"]client = MongoClient(uri, tlsCertificateKeyFile="database/cert.pem")15 unmodified linesdef Chatbot():st.title("Chatbot")if query :=st.chat_input("Enter your message"):ans = classifi(query,candidate_labels=["reminders", "general conversation"])if ans["labels"][0] == "reminders":values = getValues(query.lower())with st.chat_message("assistant"):2 unmodified lineselif ans["labels"][0] == "general conversation":umsg = bard.get_answer(query)["content"]with st.chat_message("assistant"):st.write(umsg)
app.py+5-4