Spaces:
Sleeping
Sleeping
Merge branch 'main' of https://huggingface.co/spaces/Nikhil0987/omm
Browse files- auth.py → app.py +1 -1
- chat.py +1 -2
- convo.py +10 -8
- home.py +2 -2
- requirements.txt +5 -0
auth.py → app.py
RENAMED
@@ -5,7 +5,7 @@ import json
|
|
5 |
import uuid
|
6 |
|
7 |
|
8 |
-
st.set_page_config(page_title="Authentication", page_icon=":guardsman:", layout="wide")
|
9 |
|
10 |
# st.title("Authentication")
|
11 |
|
|
|
5 |
import uuid
|
6 |
|
7 |
|
8 |
+
# st.set_page_config(page_title="Authentication", page_icon=":guardsman:", layout="wide")
|
9 |
|
10 |
# st.title("Authentication")
|
11 |
|
chat.py
CHANGED
@@ -16,13 +16,12 @@ def Chat():
|
|
16 |
if ans["scores"][0] > 0.85:
|
17 |
st.session_state["user"] = "visitor"
|
18 |
with st.chat_message("assistant"):
|
19 |
-
"You are now
|
20 |
st.experimental_rerun()
|
21 |
else:
|
22 |
with st.chat_message("assistant"):
|
23 |
chitchat
|
24 |
|
25 |
|
26 |
-
Chat()
|
27 |
|
28 |
|
|
|
16 |
if ans["scores"][0] > 0.85:
|
17 |
st.session_state["user"] = "visitor"
|
18 |
with st.chat_message("assistant"):
|
19 |
+
"You are now living in dream"
|
20 |
st.experimental_rerun()
|
21 |
else:
|
22 |
with st.chat_message("assistant"):
|
23 |
chitchat
|
24 |
|
25 |
|
|
|
26 |
|
27 |
|
convo.py
CHANGED
@@ -2,24 +2,26 @@ from transformers import pipeline, Conversation
|
|
2 |
import streamlit as st
|
3 |
from streamlit_option_menu import option_menu
|
4 |
|
|
|
5 |
|
6 |
-
def
|
7 |
-
convo
|
8 |
-
|
9 |
-
|
10 |
|
11 |
|
12 |
|
13 |
# candidate_labels = ["HELP", "PROBLEM SOLVE", "GENERAL TALK"]
|
14 |
|
15 |
|
16 |
-
|
17 |
# add_user_input = st.button("Add User Input")
|
18 |
|
19 |
# conversation.add_user_input("{}".format(convo))
|
20 |
# conversation = chatbot(conversation)
|
21 |
-
|
22 |
-
|
|
|
23 |
|
24 |
|
25 |
-
convo()
|
|
|
2 |
import streamlit as st
|
3 |
from streamlit_option_menu import option_menu
|
4 |
|
5 |
+
chatbot = pipeline(task="conversational", model="microsoft/DialoGPT-medium")
|
6 |
|
7 |
+
def Convo():
|
8 |
+
if convo := st.chat_input("Enter your message"):
|
9 |
+
|
10 |
+
conversation = Conversation(convo)
|
11 |
|
12 |
|
13 |
|
14 |
# candidate_labels = ["HELP", "PROBLEM SOLVE", "GENERAL TALK"]
|
15 |
|
16 |
|
17 |
+
ans = chatbot(conversation)
|
18 |
# add_user_input = st.button("Add User Input")
|
19 |
|
20 |
# conversation.add_user_input("{}".format(convo))
|
21 |
# conversation = chatbot(conversation)
|
22 |
+
with st.chat_message("assistant"):
|
23 |
+
ans.generated_responses[-1]
|
24 |
+
# st.write(ans)
|
25 |
|
26 |
|
27 |
+
# convo()
|
home.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
from streamlit_option_menu import option_menu
|
3 |
from chat import Chat
|
4 |
-
from convo import
|
5 |
|
6 |
def homepage():
|
7 |
st.title("Home")
|
@@ -22,7 +22,7 @@ def dashboard():
|
|
22 |
elif selected == "Chat":
|
23 |
Chat()
|
24 |
elif selected == "Conversation":
|
25 |
-
|
26 |
elif selected == "Logout":
|
27 |
st.session_state["user"] = "visitor"
|
28 |
st.experimental_rerun()
|
|
|
1 |
import streamlit as st
|
2 |
from streamlit_option_menu import option_menu
|
3 |
from chat import Chat
|
4 |
+
from convo import Convo
|
5 |
|
6 |
def homepage():
|
7 |
st.title("Home")
|
|
|
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()
|
requirements.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
streamlit-option-menu
|
3 |
+
transformers
|
4 |
+
dnspython
|
5 |
+
torch
|