Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -115,7 +115,7 @@ def is_high_risk_question(question: str) -> bool:
|
|
| 115 |
# we wrote it to be kind but firm about nutribud’s limits and to redirect users to real professionals
|
| 116 |
def safety_response(question: str) -> str:
|
| 117 |
return (
|
| 118 |
-
"i’m
|
| 119 |
"i can’t give medical advice, personalized meal plans, or recommendations for specific "
|
| 120 |
"conditions like diabetes, dizziness with fasting, or rapid weight loss. "
|
| 121 |
"it’s really important to talk to a doctor or a registered dietitian for guidance "
|
|
@@ -132,7 +132,7 @@ def build_rag_answer(question: str) -> str:
|
|
| 132 |
|
| 133 |
if not contexts:
|
| 134 |
return (
|
| 135 |
-
"right now,
|
| 136 |
"on the backend, we look up answers inside .txt files stored in the data folder of this space. "
|
| 137 |
"to enable full answers, please add trusted nutrition documents there and restart the app."
|
| 138 |
)
|
|
@@ -171,7 +171,7 @@ def nutri_chat(message: str, history: list) -> str:
|
|
| 171 |
# our earlier attempts to style themes directly caused version errors, so we keep it simple here
|
| 172 |
demo = gr.ChatInterface(
|
| 173 |
fn=nutri_chat,
|
| 174 |
-
title="🌿
|
| 175 |
description=(
|
| 176 |
"ask nutribud general questions about healthy eating and it will answer using trusted public health documents.\n"
|
| 177 |
"nutribud does not give medical advice or personalized meal plans.\n\n"
|
|
|
|
| 115 |
# we wrote it to be kind but firm about nutribud’s limits and to redirect users to real professionals
|
| 116 |
def safety_response(question: str) -> str:
|
| 117 |
return (
|
| 118 |
+
"i’m NutriBud, a general nutrition helper based on public health guidelines. "
|
| 119 |
"i can’t give medical advice, personalized meal plans, or recommendations for specific "
|
| 120 |
"conditions like diabetes, dizziness with fasting, or rapid weight loss. "
|
| 121 |
"it’s really important to talk to a doctor or a registered dietitian for guidance "
|
|
|
|
| 132 |
|
| 133 |
if not contexts:
|
| 134 |
return (
|
| 135 |
+
"right now, NutriBud doesn’t have any nutrition documents loaded.\n\n"
|
| 136 |
"on the backend, we look up answers inside .txt files stored in the data folder of this space. "
|
| 137 |
"to enable full answers, please add trusted nutrition documents there and restart the app."
|
| 138 |
)
|
|
|
|
| 171 |
# our earlier attempts to style themes directly caused version errors, so we keep it simple here
|
| 172 |
demo = gr.ChatInterface(
|
| 173 |
fn=nutri_chat,
|
| 174 |
+
title="🌿 NutriBud — friendly nutrition rag chatbot 🌿",
|
| 175 |
description=(
|
| 176 |
"ask nutribud general questions about healthy eating and it will answer using trusted public health documents.\n"
|
| 177 |
"nutribud does not give medical advice or personalized meal plans.\n\n"
|