Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -679,6 +679,33 @@ with gr.Blocks() as interface:
|
|
| 679 |
# save_to_excel(all_rows, "", "", output_file_path, is_resume=False)
|
| 680 |
# log_lines.append(f"✅ Processed {acc} ({i+1}/{total})")
|
| 681 |
print("📄 Processing accession:", acc)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 682 |
|
| 683 |
# Run summarize_results in a separate process with stop flag support
|
| 684 |
success, rows = run_with_timeout(
|
|
|
|
| 679 |
# save_to_excel(all_rows, "", "", output_file_path, is_resume=False)
|
| 680 |
# log_lines.append(f"✅ Processed {acc} ({i+1}/{total})")
|
| 681 |
print("📄 Processing accession:", acc)
|
| 682 |
+
# --- Before calling summarize_results ---
|
| 683 |
+
samples_left = total - i # including current one
|
| 684 |
+
estimated_seconds_left = samples_left * 100 # your observed average per sample
|
| 685 |
+
|
| 686 |
+
log_lines.append(
|
| 687 |
+
f"Running... usually ~100s per sample"
|
| 688 |
+
)
|
| 689 |
+
log_lines.append(
|
| 690 |
+
f"⏳ Estimated time left: ~{estimated_seconds_left} seconds ({samples_left} sample{'s' if samples_left > 1 else ''} remaining)"
|
| 691 |
+
)
|
| 692 |
+
|
| 693 |
+
# Yield update to UI before the heavy pipeline call
|
| 694 |
+
yield (
|
| 695 |
+
make_html_table(all_rows),
|
| 696 |
+
gr.update(visible=True), # results_group
|
| 697 |
+
gr.update(visible=False), # download_file
|
| 698 |
+
"", # usage_display
|
| 699 |
+
"⏳ Processing...", # status
|
| 700 |
+
"\n".join(log_lines), # progress_box
|
| 701 |
+
gr.update(visible=False), # run_button
|
| 702 |
+
gr.update(visible=True), # stop_button
|
| 703 |
+
gr.update(visible=True), # reset_button
|
| 704 |
+
gr.update(visible=False), # raw_text
|
| 705 |
+
gr.update(visible=False), # file_upload
|
| 706 |
+
gr.update(value=f"Processed/Input accessions: {', '.join(accessions)}", visible=True), # processed_info
|
| 707 |
+
gr.update(visible=False) # hide NPS modal
|
| 708 |
+
)
|
| 709 |
|
| 710 |
# Run summarize_results in a separate process with stop flag support
|
| 711 |
success, rows = run_with_timeout(
|