Spaces:
Sleeping
Sleeping
this
Browse files
app.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import os
|
|
|
|
|
|
|
| 3 |
from getvalues import getValues
|
| 4 |
from pymongo import MongoClient
|
| 5 |
from transformers import pipeline, Conversation
|
|
@@ -18,10 +20,10 @@ col = db["reminders"]
|
|
| 18 |
|
| 19 |
def Chatbot():
|
| 20 |
st.title("Chatbot")
|
| 21 |
-
if
|
| 22 |
-
ans = classifyr(
|
| 23 |
if ans["labels"][0] == "reminders":
|
| 24 |
-
values = getValues(
|
| 25 |
with st.chat_message("assistant"):
|
| 26 |
st.write(values)
|
| 27 |
col.insert_one(values)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import os
|
| 3 |
+
from bardapi import Bard
|
| 4 |
+
|
| 5 |
from getvalues import getValues
|
| 6 |
from pymongo import MongoClient
|
| 7 |
from transformers import pipeline, Conversation
|
|
|
|
| 20 |
|
| 21 |
def Chatbot():
|
| 22 |
st.title("Chatbot")
|
| 23 |
+
if query :=st.chat_input("Enter your message"):
|
| 24 |
+
ans = classifyr(query,candidate_labels=["reminders", "general conversation"])
|
| 25 |
if ans["labels"][0] == "reminders":
|
| 26 |
+
values = getValues(ans.lower())
|
| 27 |
with st.chat_message("assistant"):
|
| 28 |
st.write(values)
|
| 29 |
col.insert_one(values)
|