cringo commited on
Commit
b482dfd
·
1 Parent(s): c453f93

better status text

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -228,6 +228,7 @@ def load_job(job_id):
228
  return load_job("")
229
 
230
  if job["status"] == "processing":
 
231
  progress = job.get("progress")
232
  if progress and progress["total"] > 0:
233
  phase = progress.get("phase", "processing")
@@ -237,7 +238,7 @@ def load_job(job_id):
237
  percent = (step / total) * 100
238
  title = msg if msg else phase
239
  detail = f"{title} {step}/{total} ({percent:.0f}%)"
240
- status = f"Processing `{job['source_name']}` and `{job['target_name']}`\n\n**{detail}**"
241
  bar_html = f"""
242
  <div style="width:100%; background-color:#eee; border-radius:4px;">
243
  <div style="width:{percent}%; background-color:#4CAF50; height:20px; border-radius:4px; text-align:center; color:white; font-size:12px; line-height:20px;">
@@ -247,7 +248,7 @@ def load_job(job_id):
247
  """
248
  progress_bar_update = gr.update(value=bar_html, visible=True)
249
  else:
250
- status = f"Processing `{job['source_name']}` and `{job['target_name']}` … (initializing)"
251
  progress_bar_update = gr.update(visible=False)
252
 
253
  output = gr.update(value=None, visible=False)
 
228
  return load_job("")
229
 
230
  if job["status"] == "processing":
231
+ status = f"Processing `{job['source_name']}` and `{job['target_name']}`…"
232
  progress = job.get("progress")
233
  if progress and progress["total"] > 0:
234
  phase = progress.get("phase", "processing")
 
238
  percent = (step / total) * 100
239
  title = msg if msg else phase
240
  detail = f"{title} {step}/{total} ({percent:.0f}%)"
241
+ status += f"\n\n**{detail}**"
242
  bar_html = f"""
243
  <div style="width:100%; background-color:#eee; border-radius:4px;">
244
  <div style="width:{percent}%; background-color:#4CAF50; height:20px; border-radius:4px; text-align:center; color:white; font-size:12px; line-height:20px;">
 
248
  """
249
  progress_bar_update = gr.update(value=bar_html, visible=True)
250
  else:
251
+ status += f" (initializing)"
252
  progress_bar_update = gr.update(visible=False)
253
 
254
  output = gr.update(value=None, visible=False)