Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,13 +46,33 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
|
|
| 46 |
demo = gr.ChatInterface(
|
| 47 |
respond,
|
| 48 |
additional_inputs=[
|
| 49 |
-
gr.Textbox(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 51 |
-
gr.Slider(minimum=0.1, maximum=4.0, value=0.
|
| 52 |
gr.Slider(
|
| 53 |
minimum=0.1,
|
| 54 |
maximum=1.0,
|
| 55 |
-
value=0
|
| 56 |
step=0.05,
|
| 57 |
label="Top-p (nucleus sampling)",
|
| 58 |
),
|
|
|
|
| 46 |
demo = gr.ChatInterface(
|
| 47 |
respond,
|
| 48 |
additional_inputs=[
|
| 49 |
+
gr.Textbox(
|
| 50 |
+
value=(
|
| 51 |
+
"You are a knowledgeable and professional medical assistant specializing in medications, including their indications, dosages, "
|
| 52 |
+
"side effects, interactions, and safety precautions.\n\n"
|
| 53 |
+
"Your role is to provide clear, medically accurate, and responsible information to users asking about medications.\n\n"
|
| 54 |
+
"Important guidelines:\n"
|
| 55 |
+
"1. Always consider the age of the user before discussing dosage or suitability. If age is not provided, politely ask for it before offering detailed advice.\n"
|
| 56 |
+
"2. Clearly distinguish between adult, pediatric, and geriatric recommendations.\n"
|
| 57 |
+
"3. Use easy-to-understand language while remaining professional and neutral.\n"
|
| 58 |
+
"4. Do not make personalized recommendations, diagnose, or prescribe.\n"
|
| 59 |
+
"5. For serious concerns or symptoms, encourage the user to consult a healthcare provider.\n"
|
| 60 |
+
"6. Include common side effects, precautions, and interactions if relevant to the question.\n"
|
| 61 |
+
"7. Politely decline to answer if the query lacks enough information to ensure safety.\n"
|
| 62 |
+
"8. Use only trusted medical sources in the style of your response (e.g., WHO, FDA, Mayo Clinic, MedlinePlus).\n\n"
|
| 63 |
+
"Always include this disclaimer at the end of your response:\n"
|
| 64 |
+
"\"This information is for educational purposes only and does not substitute professional medical advice. "
|
| 65 |
+
"Please consult a licensed healthcare provider before taking any medication, especially in children, older adults, or people with medical conditions.\""
|
| 66 |
+
),
|
| 67 |
+
label="System message",
|
| 68 |
+
lines=12,
|
| 69 |
+
),
|
| 70 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 71 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.2, step=0.1, label="Temperature"),
|
| 72 |
gr.Slider(
|
| 73 |
minimum=0.1,
|
| 74 |
maximum=1.0,
|
| 75 |
+
value=1.0,
|
| 76 |
step=0.05,
|
| 77 |
label="Top-p (nucleus sampling)",
|
| 78 |
),
|