Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,26 +10,7 @@ from streamlit_chat import message
|
|
| 10 |
from PIL import Image
|
| 11 |
|
| 12 |
st.title("Nexus TCM Chatbot")
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
# Create the search bar
|
| 16 |
-
query = st.text_input("Query:", key="input")
|
| 17 |
-
|
| 18 |
-
# Create a button to clear the input
|
| 19 |
-
if st.button("Clear Input"):
|
| 20 |
-
# Process the query and generate a response
|
| 21 |
-
response = f"User entered: {st.session_state.input}"
|
| 22 |
-
st.write(response)
|
| 23 |
-
|
| 24 |
-
# Clear the input by setting a flag
|
| 25 |
-
st.session_state.clear_input_flag = True
|
| 26 |
-
|
| 27 |
-
# Check if the input needs to be cleared
|
| 28 |
-
if hasattr(st.session_state, 'clear_input_flag') and st.session_state.clear_input_flag:
|
| 29 |
-
# Clear the input
|
| 30 |
-
st.session_state.input = ""
|
| 31 |
-
# Reset the flag
|
| 32 |
-
st.session_state.clear_input_flag = False
|
| 33 |
|
| 34 |
# Set the logo URL
|
| 35 |
#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 |
# Set the logo URL
|
| 16 |
#logo_url = "https://huggingface.co/spaces/mathslearn/chatbot_test_streamlit/blob/main/logo.jpeg"
|