CelagenexResearch commited on
Commit
2d64122
·
verified ·
1 Parent(s): d5fc154

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -42
app.py CHANGED
@@ -1185,7 +1185,7 @@ custom_css = """
1185
  }
1186
  """
1187
 
1188
- # UPDATED GRADIO INTERFACE WITH CLEAN QUESTIONNAIRE UI
1189
  with gr.Blocks(
1190
  title="🐶 Enhanced AI Dog Health Analyzer",
1191
  theme=gr.themes.Soft(),
@@ -1265,11 +1265,11 @@ with gr.Blocks(
1265
  maximum=25
1266
  )
1267
 
1268
- # Right Column - CLEAN HRQOL Questionnaire Form
1269
  with gr.Column(scale=1):
1270
  # Clean questionnaire header
1271
  gr.HTML("""
1272
- <div class="clean-questionnaire-card">
1273
  <div style="text-align: center; margin-bottom: 24px;">
1274
  <h2 style="color: #1f2937; margin: 0 0 8px 0; font-size: 1.6em; font-weight: 600;">
1275
  📋 Health Assessment Form
@@ -1283,45 +1283,35 @@ with gr.Blocks(
1283
 
1284
  hrqol_inputs = []
1285
 
1286
- # Clean questionnaire form layout
1287
- with gr.Group(elem_classes=["clean-form"]):
1288
- for i, (domain_key, domain_data) in enumerate(HRQOL_QUESTIONNAIRE.items()):
1289
- # Clean section header
1290
- gr.HTML(f"""<div class="clean-section-header">
1291
- <h3 style="margin: 0; color: #1f2937; font-size: 1.1em; font-weight: 600; display: flex; align-items: center;">
1292
- <span style="margin-right: 8px;">{domain_data['title'].split()[0]}</span>
1293
- {domain_data['title'].split()[1:][0] if len(domain_data['title'].split()) > 1 else ''}
1294
- </h3>
1295
- <p style="margin: 6px 0 0 0; color: #6b7280; font-size: 0.9em; line-height: 1.3;">
1296
- {domain_data['description']}
1297
- </p>
1298
- </div>""")
1299
-
1300
- # Clean question form field
1301
- for question in domain_data["questions"]:
1302
- # Clean question container
1303
- gr.HTML(f"""
1304
- <div style="margin: 16px 0;">
1305
- <label style="display: block; font-size: 0.95em; font-weight: 500; color: #374151; margin-bottom: 8px; line-height: 1.4;">
1306
- {question["text"]}
1307
- </label>
1308
- </div>
1309
- """)
1310
-
1311
- dropdown = gr.Dropdown(
1312
- choices=question["options"],
1313
- label="", # Remove label since we're showing it above
1314
- placeholder="Select your answer...",
1315
- value=None,
1316
- interactive=True,
1317
- container=False,
1318
- elem_classes=["clean-dropdown"]
1319
- )
1320
- hrqol_inputs.append(dropdown)
1321
-
1322
- # Clean separator between sections (except last)
1323
- if i < len(HRQOL_QUESTIONNAIRE) - 1:
1324
- gr.HTML('<hr class="clean-separator">')
1325
 
1326
  # Clean Analysis Button
1327
  gr.HTML("""
 
1185
  }
1186
  """
1187
 
1188
+ # FIXED GRADIO INTERFACE WITH CLEAN QUESTIONNAIRE UI (NO ERRORS)
1189
  with gr.Blocks(
1190
  title="🐶 Enhanced AI Dog Health Analyzer",
1191
  theme=gr.themes.Soft(),
 
1265
  maximum=25
1266
  )
1267
 
1268
+ # Right Column - CLEAN HRQOL Questionnaire Form (FIXED - NO ERRORS)
1269
  with gr.Column(scale=1):
1270
  # Clean questionnaire header
1271
  gr.HTML("""
1272
+ <div style="background: white; border-radius: 12px; padding: 25px; margin: 10px 0; box-shadow: 0 4px 12px rgba(0,0,0,0.08);">
1273
  <div style="text-align: center; margin-bottom: 24px;">
1274
  <h2 style="color: #1f2937; margin: 0 0 8px 0; font-size: 1.6em; font-weight: 600;">
1275
  📋 Health Assessment Form
 
1283
 
1284
  hrqol_inputs = []
1285
 
1286
+ # Clean questionnaire form layout - FIXED VERSION
1287
+ for i, (domain_key, domain_data) in enumerate(HRQOL_QUESTIONNAIRE.items()):
1288
+ # Clean section header
1289
+ gr.HTML(f"""
1290
+ <div style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 16px; margin: 16px 0 8px 0; border-left: 4px solid #667eea;">
1291
+ <h3 style="margin: 0; color: #1f2937; font-size: 1.1em; font-weight: 600; display: flex; align-items: center;">
1292
+ <span style="margin-right: 8px;">{domain_data['title'].split()[0]}</span>
1293
+ {domain_data['title'].split()[1:][0] if len(domain_data['title'].split()) > 1 else ''}
1294
+ </h3>
1295
+ <p style="margin: 6px 0 0 0; color: #6b7280; font-size: 0.9em; line-height: 1.3;">
1296
+ {domain_data['description']}
1297
+ </p>
1298
+ </div>
1299
+ """)
1300
+
1301
+ # Clean question form field - FIXED: No placeholder parameter
1302
+ for question in domain_data["questions"]:
1303
+ dropdown = gr.Dropdown(
1304
+ choices=question["options"],
1305
+ label=question["text"], # Show full question as label
1306
+ value=None,
1307
+ interactive=True,
1308
+ container=True
1309
+ )
1310
+ hrqol_inputs.append(dropdown)
1311
+
1312
+ # Clean separator between sections (except last)
1313
+ if i < len(HRQOL_QUESTIONNAIRE) - 1:
1314
+ gr.HTML('<div style="height: 1px; background: #e5e7eb; margin: 20px 0; border: none;"></div>')
 
 
 
 
 
 
 
 
 
 
1315
 
1316
  # Clean Analysis Button
1317
  gr.HTML("""