Nikhil0987 commited on
Commit
d75866e
1 Parent(s): 3911b7f
Files changed (3) hide show
  1. auth.py +1 -0
  2. convo.py +18 -20
  3. home.py +7 -1
auth.py CHANGED
@@ -92,6 +92,7 @@ def main():
92
  login()
93
  elif option == "Signup":
94
  signup()
 
95
 
96
 
97
  main()
 
92
  login()
93
  elif option == "Signup":
94
  signup()
95
+
96
 
97
 
98
  main()
convo.py CHANGED
@@ -5,23 +5,21 @@ from streamlit_option_menu import option_menu
5
 
6
  def convo():
7
  convo = st.text_input("Enter your message")
8
- chatbot = pipeline(task= "conversational" ,model="microsoft/DialoGPT-medium")
9
- # usrinput = Conversation(convo)
10
- # chitchat = chatbot(usrinput)
11
-
12
- ans = chatbot(
13
- convo,candidate_labels=["HELP","PROBLEM SOLVE","GENERAL TALK"])
14
- conversation.generated_responses[-1]
15
-
16
- if ans["scores"][0] > 0.85:
17
- st.session_state["user"] = "visitor"
18
- with st.chat_message("assistant"):
19
- "You are now sleeping in dream"
20
- st.experimental_rerun()
21
- else:
22
- with st.chat_message("assistant"):
23
- chitchat
24
-
25
-
26
- convo()
27
-
 
5
 
6
  def convo():
7
  convo = st.text_input("Enter your message")
8
+ chatbot = pipeline(task="conversational", model="microsoft/DialoGPT-medium")
9
+ conversation = Conversation(convo)
10
+
11
+
12
+
13
+ # candidate_labels = ["HELP", "PROBLEM SOLVE", "GENERAL TALK"]
14
+
15
+
16
+ ans = chatbot(conversation)
17
+ # add_user_input = st.button("Add User Input")
18
+
19
+ # conversation.add_user_input("{}".format(convo))
20
+ # conversation = chatbot(conversation)
21
+ # conversation.generated_responses[-1]
22
+ st.write(ans)
23
+
24
+
25
+ convo()
 
 
home.py CHANGED
@@ -13,7 +13,7 @@ def dashboard():
13
  # st.header("Dashboard")
14
 
15
  with st.sidebar:
16
- selected = option_menu("Menu", ["Home", "Dashboard","Chat","Logout"], icons=['house', 'activity'], menu_icon="cast", default_index=0)
17
  if selected == "Home":
18
  homepage()
19
 
@@ -21,6 +21,12 @@ def dashboard():
21
  "gfjfvjhvjhv"
22
  elif selected == "Chat":
23
  Chat()
 
 
 
 
 
 
24
 
25
 
26
 
 
13
  # st.header("Dashboard")
14
 
15
  with st.sidebar:
16
+ selected = option_menu("Menu", ["Home", "Dashboard","Chat","Conversation","Logout"], icons=['house', 'activity'], menu_icon="cast", default_index=0)
17
  if selected == "Home":
18
  homepage()
19
 
 
21
  "gfjfvjhvjhv"
22
  elif selected == "Chat":
23
  Chat()
24
+ elif selected == "Conversation":
25
+ convo()
26
+ elif selected == "Logout":
27
+ st.session_state["user"] = "visitor"
28
+ st.experimental_rerun()
29
+
30
 
31
 
32