Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -253,16 +253,12 @@ textarea:hover, input:hover {
|
|
253 |
# Gradio Application
|
254 |
with gr.Blocks(css=custom_css) as app:
|
255 |
gr.HTML("<h1>π Well-Being Companion</h1>")
|
|
|
256 |
with gr.Row():
|
257 |
user_input = gr.Textbox(label="Please Enter Your Message Here")
|
258 |
location = gr.Textbox(label="Please Enter Your Current Location Here")
|
259 |
query = gr.Textbox(label="Please Enter Which Health Professional You Want To Search Nearby")
|
260 |
-
|
261 |
-
# New Predict Disease Button
|
262 |
-
predict_disease = gr.Button(value="Predict Disease", variant="secondary")
|
263 |
-
predict_disease.click(lambda: None, _js="window.open('https://huggingface.co/spaces/Mishal23/wellBeing', '_blank')")
|
264 |
-
|
265 |
-
# Existing Submit Button
|
266 |
submit = gr.Button(value="Submit", variant="primary")
|
267 |
|
268 |
chatbot = gr.Chatbot(label="Chat History")
|
@@ -281,5 +277,22 @@ with gr.Blocks(css=custom_css) as app:
|
|
281 |
inputs=[user_input, location, query, chatbot],
|
282 |
outputs=[chatbot, sentiment, emotion, suggestions, professionals, map_html],
|
283 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
|
285 |
-
app.launch()
|
|
|
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")
|
|
|
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()
|