DreamStream-1 commited on
Commit
be71103
·
verified ·
1 Parent(s): 1920c47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -231,9 +231,7 @@ def app_function_chatbot(user_input, location, query, history):
231
  # Disease Prediction Logic
232
  def predict_disease(symptoms):
233
  """Predict disease based on input symptoms."""
234
- # Filter out None values
235
- valid_symptoms = [s for s in symptoms if s is not None]
236
- # Ensure at least 3 symptoms are selected
237
  if len(valid_symptoms) < 3:
238
  return "Please select at least 3 symptoms for a better prediction."
239
 
@@ -268,14 +266,13 @@ with gr.Blocks(theme='shivi/calm_seafoam') as app: # Apply the specified theme
268
  query = gr.Textbox(label="Search Health Professionals Nearby", placeholder="E.g., Health Professionals", max_lines=1)
269
 
270
  with gr.Row(): # Align Submit and Clear buttons side by side
271
- submit_chatbot = gr.Button(value="Submit Your Message", variant="primary")
272
  clear_chatbot = gr.Button(value="Clear", variant="secondary") # Clear button
273
 
274
  chatbot = gr.Chatbot(label="Chat History", show_label=True)
275
  sentiment = gr.Textbox(label="Detected Sentiment", show_label=True)
276
  emotion = gr.Textbox(label="Detected Emotion", show_label=True)
277
 
278
- # Keep the DataFrame styling uniform
279
  suggestions_markdown = gr.Markdown(label="Suggestions")
280
  professionals = gr.DataFrame(label="Nearby Health Professionals", headers=["Name", "Address"])
281
  map_html = gr.HTML(label="Interactive Map")
@@ -303,7 +300,7 @@ with gr.Blocks(theme='shivi/calm_seafoam') as app: # Apply the specified theme
303
  symptom4 = gr.Dropdown(choices=[None] + list(X_train.columns), label="Select Symptom 4", value=None)
304
  symptom5 = gr.Dropdown(choices=[None] + list(X_train.columns), label="Select Symptom 5", value=None)
305
 
306
- submit_disease = gr.Button(value="Predict Disease", variant="primary")
307
 
308
  disease_prediction_result = gr.Markdown(label="Predicted Diseases")
309
 
 
231
  # Disease Prediction Logic
232
  def predict_disease(symptoms):
233
  """Predict disease based on input symptoms."""
234
+ valid_symptoms = [s for s in symptoms if s is not None] # Filter out None values
 
 
235
  if len(valid_symptoms) < 3:
236
  return "Please select at least 3 symptoms for a better prediction."
237
 
 
266
  query = gr.Textbox(label="Search Health Professionals Nearby", placeholder="E.g., Health Professionals", max_lines=1)
267
 
268
  with gr.Row(): # Align Submit and Clear buttons side by side
269
+ submit_chatbot = gr.Button(value="Submit Your Message", variant="primary", icon="fa-paper-plane")
270
  clear_chatbot = gr.Button(value="Clear", variant="secondary") # Clear button
271
 
272
  chatbot = gr.Chatbot(label="Chat History", show_label=True)
273
  sentiment = gr.Textbox(label="Detected Sentiment", show_label=True)
274
  emotion = gr.Textbox(label="Detected Emotion", show_label=True)
275
 
 
276
  suggestions_markdown = gr.Markdown(label="Suggestions")
277
  professionals = gr.DataFrame(label="Nearby Health Professionals", headers=["Name", "Address"])
278
  map_html = gr.HTML(label="Interactive Map")
 
300
  symptom4 = gr.Dropdown(choices=[None] + list(X_train.columns), label="Select Symptom 4", value=None)
301
  symptom5 = gr.Dropdown(choices=[None] + list(X_train.columns), label="Select Symptom 5", value=None)
302
 
303
+ submit_disease = gr.Button(value="Predict Disease", variant="primary", icon="fa-stethoscope")
304
 
305
  disease_prediction_result = gr.Markdown(label="Predicted Diseases")
306