Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -265,7 +265,7 @@ function createGradioAnimation() {
|
|
| 265 |
container.style.textAlign = 'center';
|
| 266 |
container.style.marginBottom = '20px';
|
| 267 |
|
| 268 |
-
var text = 'Welcome to
|
| 269 |
for (var i = 0; i < text.length; i++) {
|
| 270 |
(function(i){
|
| 271 |
setTimeout(function(){
|
|
@@ -286,15 +286,14 @@ function createGradioAnimation() {
|
|
| 286 |
var gradioContainer = document.querySelector('.gradio-container');
|
| 287 |
gradioContainer.insertBefore(container, gradioContainer.firstChild);
|
| 288 |
}
|
|
|
|
|
|
|
| 289 |
"""
|
| 290 |
|
| 291 |
# Gradio Application Interface with JS Animation
|
| 292 |
-
with gr.Blocks(js=js) as app:
|
| 293 |
gr.HTML("<h1 id='welcome-title'>🌟 Well-Being Companion</h1>")
|
| 294 |
|
| 295 |
-
# Initialize the animation on load
|
| 296 |
-
createGradioAnimation() # This function will be defined in the JavaScript context
|
| 297 |
-
|
| 298 |
with gr.Tab("Well-Being Chatbot"):
|
| 299 |
with gr.Row():
|
| 300 |
user_input = gr.Textbox(label="Please Enter Your Message Here", placeholder="Type your message here...", max_lines=3)
|
|
@@ -302,7 +301,7 @@ with gr.Blocks(js=js) as app:
|
|
| 302 |
query = gr.Textbox(label="Search Health Professionals Nearby", placeholder="E.g., Health Professionals", max_lines=1)
|
| 303 |
|
| 304 |
with gr.Row(): # Align Submit and Clear buttons side by side
|
| 305 |
-
submit_chatbot = gr.Button(value="Submit Your Message", variant="primary")
|
| 306 |
clear_chatbot = gr.Button(value="Clear", variant="secondary") # Clear button
|
| 307 |
|
| 308 |
chatbot = gr.Chatbot(label="Chat History", show_label=True)
|
|
@@ -336,7 +335,7 @@ with gr.Blocks(js=js) as app:
|
|
| 336 |
symptom4 = gr.Dropdown(choices=[None] + list(X_train.columns), label="Select Symptom 4", value=None)
|
| 337 |
symptom5 = gr.Dropdown(choices=[None] + list(X_train.columns), label="Select Symptom 5", value=None)
|
| 338 |
|
| 339 |
-
submit_disease = gr.Button(value="Predict Disease", variant="primary")
|
| 340 |
|
| 341 |
disease_prediction_result = gr.Markdown(label="Predicted Diseases")
|
| 342 |
|
|
|
|
| 265 |
container.style.textAlign = 'center';
|
| 266 |
container.style.marginBottom = '20px';
|
| 267 |
|
| 268 |
+
var text = 'Welcome to the Well-Being Companion!';
|
| 269 |
for (var i = 0; i < text.length; i++) {
|
| 270 |
(function(i){
|
| 271 |
setTimeout(function(){
|
|
|
|
| 286 |
var gradioContainer = document.querySelector('.gradio-container');
|
| 287 |
gradioContainer.insertBefore(container, gradioContainer.firstChild);
|
| 288 |
}
|
| 289 |
+
|
| 290 |
+
createGradioAnimation(); // Call the animation function upon load
|
| 291 |
"""
|
| 292 |
|
| 293 |
# Gradio Application Interface with JS Animation
|
| 294 |
+
with gr.Blocks(js=js, analytics_enabled=False) as app:
|
| 295 |
gr.HTML("<h1 id='welcome-title'>🌟 Well-Being Companion</h1>")
|
| 296 |
|
|
|
|
|
|
|
|
|
|
| 297 |
with gr.Tab("Well-Being Chatbot"):
|
| 298 |
with gr.Row():
|
| 299 |
user_input = gr.Textbox(label="Please Enter Your Message Here", placeholder="Type your message here...", max_lines=3)
|
|
|
|
| 301 |
query = gr.Textbox(label="Search Health Professionals Nearby", placeholder="E.g., Health Professionals", max_lines=1)
|
| 302 |
|
| 303 |
with gr.Row(): # Align Submit and Clear buttons side by side
|
| 304 |
+
submit_chatbot = gr.Button(value="Submit Your Message", variant="primary", icon="fa-paper-plane")
|
| 305 |
clear_chatbot = gr.Button(value="Clear", variant="secondary") # Clear button
|
| 306 |
|
| 307 |
chatbot = gr.Chatbot(label="Chat History", show_label=True)
|
|
|
|
| 335 |
symptom4 = gr.Dropdown(choices=[None] + list(X_train.columns), label="Select Symptom 4", value=None)
|
| 336 |
symptom5 = gr.Dropdown(choices=[None] + list(X_train.columns), label="Select Symptom 5", value=None)
|
| 337 |
|
| 338 |
+
submit_disease = gr.Button(value="Predict Disease", variant="primary", icon="fa-stethoscope")
|
| 339 |
|
| 340 |
disease_prediction_result = gr.Markdown(label="Predicted Diseases")
|
| 341 |
|