Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -785,7 +785,14 @@ def nutrition_disorder_streamlit():
|
|
| 785 |
st.write(message["content"])
|
| 786 |
|
| 787 |
# Chat input with custom placeholder text
|
| 788 |
-
user_query = st.chat_input("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 789 |
if user_query:
|
| 790 |
if user_query.lower() == "exit":
|
| 791 |
st.session_state.chat_history.append({"role": "user", "content": "exit"})
|
|
|
|
| 785 |
st.write(message["content"])
|
| 786 |
|
| 787 |
# Chat input with custom placeholder text
|
| 788 |
+
user_query = st.chat_input("Type your question here (or 'exit' to end: ").strip() # Blank #1: Fill in the chat input prompt (e.g., "Type your question here (or 'exit' to end)...")
|
| 789 |
+
|
| 790 |
+
# Check if user_query is None before calling .strip()
|
| 791 |
+
if user_query:
|
| 792 |
+
user_query = user_query.strip()
|
| 793 |
+
else:
|
| 794 |
+
user_query = "" # Default to an empty string if no input is provided
|
| 795 |
+
|
| 796 |
if user_query:
|
| 797 |
if user_query.lower() == "exit":
|
| 798 |
st.session_state.chat_history.append({"role": "user", "content": "exit"})
|