Dineshpopuri commited on
Commit
2f8bbfb
·
verified ·
1 Parent(s): 72a7bc7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -140,9 +140,10 @@ def evaluate_readiness(logs, qa_report, punch_list_text):
140
  checklist_summary = "\n".join(checklist_details)
141
  missing_summary = "None" if not missing_items else ", ".join(missing_items)
142
 
143
- # Generate progress bar HTML (alert indicator)
144
- color = "red" if score < 70 else "yellow" if score < 90 else "green"
145
- progress_bar = f'<progress value="{score}" max="100" style="width:100%;height:20px;background-color:{color}">{score}%</progress>'
 
146
 
147
  # Automatically create Salesforce record
148
  create_salesforce_record(score, checklist_summary, missing_summary, status)
@@ -245,7 +246,10 @@ def generate_pdf(score, checklist_summary, missing_summary, status):
245
  raise
246
 
247
  # Gradio interface with updated UI
248
- with gr.Blocks(css="""progress { background-color: #f0f0f0; } .red { background-color: red; }""") as demo:
 
 
 
249
  gr.Markdown(
250
  """
251
  # Project Closure Readiness Evaluator
 
140
  checklist_summary = "\n".join(checklist_details)
141
  missing_summary = "None" if not missing_items else ", ".join(missing_items)
142
 
143
+ # Generate progress bar HTML (alert indicator) using CSS classes
144
+ color_class = "red" if score < 70 else "yellow" if score <= 90 else "green" # Adjusted to match Markdown
145
+ logging.info(f"Readiness Score: {score}%, Color Class: {color_class}") # Debug logging
146
+ progress_bar = f'<progress class="{color_class}" value="{score}" max="100" style="width:100%;height:20px">{score}%</progress>'
147
 
148
  # Automatically create Salesforce record
149
  create_salesforce_record(score, checklist_summary, missing_summary, status)
 
246
  raise
247
 
248
  # Gradio interface with updated UI
249
+ with gr.Blocks(css="""progress { background-color: #f0f0f0; width: 100%; height: 20px; }
250
+ progress.red { background-color: red; }
251
+ progress.yellow { background-color: yellow; }
252
+ progress.green { background-color: green; }""") as demo:
253
  gr.Markdown(
254
  """
255
  # Project Closure Readiness Evaluator