Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -251,23 +251,27 @@ textarea:hover, input:hover {
|
|
251 |
}
|
252 |
"""
|
253 |
# Gradio Application
|
|
|
254 |
with gr.Blocks(css=custom_css) as app:
|
255 |
gr.HTML("<h1>π Well-Being Companion</h1>")
|
256 |
-
|
257 |
with gr.Row():
|
258 |
user_input = gr.Textbox(label="Please Enter Your Message Here")
|
259 |
location = gr.Textbox(label="Please Enter Your Current Location Here")
|
260 |
query = gr.Textbox(label="Please Enter Which Health Professional You Want To Search Nearby")
|
261 |
-
|
|
|
|
|
|
|
|
|
262 |
submit = gr.Button(value="Submit", variant="primary")
|
263 |
|
264 |
chatbot = gr.Chatbot(label="Chat History")
|
265 |
sentiment = gr.Textbox(label="Detected Sentiment")
|
266 |
emotion = gr.Textbox(label="Detected Emotion")
|
267 |
-
|
268 |
# Adding Suggestions Title with Styled Markdown (Centered and Bold)
|
269 |
gr.Markdown("Suggestions", elem_id="suggestions-title")
|
270 |
-
|
271 |
suggestions = gr.DataFrame(headers=["Title", "Link"]) # Table for suggestions
|
272 |
professionals = gr.DataFrame(label="Nearby Health Professionals", headers=["Name", "Address"]) # Changed to DataFrame
|
273 |
map_html = gr.HTML(label="Interactive Map")
|
@@ -277,22 +281,6 @@ with gr.Blocks(css=custom_css) as app:
|
|
277 |
inputs=[user_input, location, query, chatbot],
|
278 |
outputs=[chatbot, sentiment, emotion, suggestions, professionals, map_html],
|
279 |
)
|
280 |
-
|
281 |
-
# Adding WellBeing Space Button
|
282 |
-
with gr.Row():
|
283 |
-
wellbeing_space_button = gr.Button("Open WellBeing Space")
|
284 |
-
|
285 |
-
# Markdown output for the link
|
286 |
-
wellbeing_link = gr.Markdown(
|
287 |
-
'<a href="https://huggingface.co/spaces/Mishal23/wellBeing" target="_blank">Open WellBeing Space</a>',
|
288 |
-
visible=False,
|
289 |
-
elem_id="wellbeing-link"
|
290 |
-
)
|
291 |
-
|
292 |
-
# Show link when the button is clicked
|
293 |
-
wellbeing_space_button.click(
|
294 |
-
lambda: ("Click the link below to access WellBeing Space:", gr.update(visible=True)),
|
295 |
-
outputs=["text", wellbeing_link]
|
296 |
-
)
|
297 |
|
298 |
app.launch()
|
|
|
|
251 |
}
|
252 |
"""
|
253 |
# Gradio Application
|
254 |
+
|
255 |
with gr.Blocks(css=custom_css) as app:
|
256 |
gr.HTML("<h1>π Well-Being Companion</h1>")
|
|
|
257 |
with gr.Row():
|
258 |
user_input = gr.Textbox(label="Please Enter Your Message Here")
|
259 |
location = gr.Textbox(label="Please Enter Your Current Location Here")
|
260 |
query = gr.Textbox(label="Please Enter Which Health Professional You Want To Search Nearby")
|
261 |
+
|
262 |
+
# Predict Disease Button
|
263 |
+
predict_disease = gr.Button(value="Predict Disease", variant="secondary")
|
264 |
+
predict_disease.click(lambda: None, [], _js=f"() => window.open('https://huggingface.co/spaces/Mishal23/wellBeing', '_blank')")
|
265 |
+
|
266 |
submit = gr.Button(value="Submit", variant="primary")
|
267 |
|
268 |
chatbot = gr.Chatbot(label="Chat History")
|
269 |
sentiment = gr.Textbox(label="Detected Sentiment")
|
270 |
emotion = gr.Textbox(label="Detected Emotion")
|
271 |
+
|
272 |
# Adding Suggestions Title with Styled Markdown (Centered and Bold)
|
273 |
gr.Markdown("Suggestions", elem_id="suggestions-title")
|
274 |
+
|
275 |
suggestions = gr.DataFrame(headers=["Title", "Link"]) # Table for suggestions
|
276 |
professionals = gr.DataFrame(label="Nearby Health Professionals", headers=["Name", "Address"]) # Changed to DataFrame
|
277 |
map_html = gr.HTML(label="Interactive Map")
|
|
|
281 |
inputs=[user_input, location, query, chatbot],
|
282 |
outputs=[chatbot, sentiment, emotion, suggestions, professionals, map_html],
|
283 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
|
285 |
app.launch()
|
286 |
+
|