Ankush05 commited on
Commit
4025e7c
1 Parent(s): bd004c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -3,6 +3,7 @@ import os
3
  from transformers import pipeline
4
  from bardapi import Bard
5
  import os
 
6
 
7
  bardkey = os.environ.get("BARD_API_KEY")
8
 
@@ -15,12 +16,16 @@ classifi = pipeline(model="facebook/bart-large-mnli")
15
 
16
  def chatbot():
17
  st.title("ChatBot")
18
- if message := st.chat_input("Enter your message"):
19
  ans = classifi(message, candidate_labels=["Reminder", "General Conversation"])
20
- umsg = bard.get_answer(message)["content"]
21
- with st.chat_message("assistant"):
22
- st.write(umsg)
23
- st.write(ans)
 
 
 
 
24
 
25
 
26
 
 
3
  from transformers import pipeline
4
  from bardapi import Bard
5
  import os
6
+ from getvalues import getValues
7
 
8
  bardkey = os.environ.get("BARD_API_KEY")
9
 
 
16
 
17
  def chatbot():
18
  st.title("ChatBot")
19
+ if query := st.chat_input("Enter your message"):
20
  ans = classifi(message, candidate_labels=["Reminder", "General Conversation"])
21
+ if ans["labels"][0] == "Reminder":
22
+ values = getValues(query)
23
+ with st.chat_message("assistant"):
24
+ st.write(values)
25
+ elif ans["labels"][0] == "General Conversation":
26
+ umsg = bard.get_answer(message)["content"]
27
+ with st.chat_message("assistant"):
28
+ st.write(umsg)
29
 
30
 
31