Spaces:
Sleeping
Sleeping
mathslearn
commited on
Commit
•
c0e52f1
1
Parent(s):
60862d5
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,19 @@ from streamlit_chat import message
|
|
10 |
from PIL import Image
|
11 |
|
12 |
st.title("Nexus TCM Chatbot")
|
13 |
-
query = st.text_input("Query: ", key="input")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
# Set the logo URL
|
16 |
#logo_url = "https://huggingface.co/spaces/mathslearn/chatbot_test_streamlit/blob/main/logo.jpeg"
|
|
|
10 |
from PIL import Image
|
11 |
|
12 |
st.title("Nexus TCM Chatbot")
|
13 |
+
#query = st.text_input("Query: ", key="input")
|
14 |
+
|
15 |
+
#https://discuss.streamlit.io/t/clear-input-box-after-hitting-enter/33824/2
|
16 |
+
if 'something' not in st.session_state:
|
17 |
+
st.session_state.something = ''
|
18 |
+
|
19 |
+
def submit():
|
20 |
+
st.session_state.something = st.session_state.widget
|
21 |
+
st.session_state.widget = ''
|
22 |
+
|
23 |
+
query = st.text_input('Something', key='widget', on_change=submit)
|
24 |
+
|
25 |
+
st.write(f'Last submission: {st.session_state.something}')
|
26 |
|
27 |
# Set the logo URL
|
28 |
#logo_url = "https://huggingface.co/spaces/mathslearn/chatbot_test_streamlit/blob/main/logo.jpeg"
|