Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -251,9 +251,64 @@ def predict_disease(symptoms):
|
|
251 |
|
252 |
return "\n".join(markdown_output)
|
253 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
# Gradio Application Interface
|
255 |
-
with gr.Blocks() as app:
|
256 |
-
gr.HTML("<h1>🌟 Well-Being For
|
257 |
|
258 |
with gr.Tab("Well-Being Chatbot"):
|
259 |
with gr.Row():
|
@@ -261,13 +316,13 @@ with gr.Blocks() as app:
|
|
261 |
location = gr.Textbox(label="Please Enter Your Current Location Here")
|
262 |
query = gr.Textbox(label="Please Enter Which Health Professional You Want To Search Nearby")
|
263 |
|
264 |
-
submit_chatbot = gr.Button(value="Submit Your Message", variant="primary")
|
265 |
|
266 |
chatbot = gr.Chatbot(label="Chat History")
|
267 |
sentiment = gr.Textbox(label="Detected Sentiment")
|
268 |
emotion = gr.Textbox(label="Detected Emotion")
|
269 |
|
270 |
-
suggestions_markdown = gr.Markdown(label="Suggestions") # Markdown for displaying
|
271 |
professionals = gr.DataFrame(label="Nearby Health Professionals", headers=["Name", "Address"])
|
272 |
map_html = gr.HTML(label="Interactive Map")
|
273 |
|
|
|
251 |
|
252 |
return "\n".join(markdown_output)
|
253 |
|
254 |
+
# Custom CSS for Styling
|
255 |
+
custom_css = """
|
256 |
+
body {
|
257 |
+
font-family: 'Arial', sans-serif;
|
258 |
+
background-color: #f0f4f7; /* Light background for better contrast */
|
259 |
+
}
|
260 |
+
|
261 |
+
h1 {
|
262 |
+
background: linear-gradient(135deg, #3c6487, #355f7a); /* Gradient using your color */
|
263 |
+
color: #ffffff;
|
264 |
+
border-radius: 12px;
|
265 |
+
padding: 15px;
|
266 |
+
text-align: center;
|
267 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Shadow effect */
|
268 |
+
}
|
269 |
+
|
270 |
+
textarea, input {
|
271 |
+
background: white; /* Input background */
|
272 |
+
color: black;
|
273 |
+
border: 2px solid #3c6487; /* Matching border color */
|
274 |
+
padding: 10px;
|
275 |
+
font-size: 1rem;
|
276 |
+
border-radius: 10px;
|
277 |
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Light shadow for inputs */
|
278 |
+
}
|
279 |
+
|
280 |
+
.gr-button {
|
281 |
+
background-color: #ae1c93; /* Set the button color */
|
282 |
+
color: white;
|
283 |
+
border-radius: 8px;
|
284 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Shadow on button */
|
285 |
+
}
|
286 |
+
|
287 |
+
.gr-button:hover {
|
288 |
+
background-color: #8f167b; /* Darker shade on hover */
|
289 |
+
}
|
290 |
+
|
291 |
+
.gr-button:active {
|
292 |
+
background-color: #7f156b; /* Even darker shade on active */
|
293 |
+
}
|
294 |
+
|
295 |
+
.df-container {
|
296 |
+
background: white;
|
297 |
+
color: black;
|
298 |
+
border: 2px solid #3c6487; /* Matching border color for data frames */
|
299 |
+
border-radius: 10px;
|
300 |
+
padding: 10px;
|
301 |
+
font-size: 14px;
|
302 |
+
max-height: 400px;
|
303 |
+
height: auto;
|
304 |
+
overflow-y: auto;
|
305 |
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Light shadow for data frame */
|
306 |
+
}
|
307 |
+
"""
|
308 |
+
|
309 |
# Gradio Application Interface
|
310 |
+
with gr.Blocks(css=custom_css) as app:
|
311 |
+
gr.HTML("<h1>🌟 Well-Being For All </h1>")
|
312 |
|
313 |
with gr.Tab("Well-Being Chatbot"):
|
314 |
with gr.Row():
|
|
|
316 |
location = gr.Textbox(label="Please Enter Your Current Location Here")
|
317 |
query = gr.Textbox(label="Please Enter Which Health Professional You Want To Search Nearby")
|
318 |
|
319 |
+
submit_chatbot = gr.Button(value="Submit Your Message Here", variant="primary")
|
320 |
|
321 |
chatbot = gr.Chatbot(label="Chat History")
|
322 |
sentiment = gr.Textbox(label="Detected Sentiment")
|
323 |
emotion = gr.Textbox(label="Detected Emotion")
|
324 |
|
325 |
+
suggestions_markdown = gr.Markdown(label="Suggestions") # Markdown for displaying suggestions
|
326 |
professionals = gr.DataFrame(label="Nearby Health Professionals", headers=["Name", "Address"])
|
327 |
map_html = gr.HTML(label="Interactive Map")
|
328 |
|