Claude commited on
Commit
d1665e8
·
1 Parent(s): 4260bdd

fix: yield after each Surya batch — live progress, no more silent hang

Browse files
Files changed (1) hide show
  1. smoke_signal_tab.py +4 -0
smoke_signal_tab.py CHANGED
@@ -2243,6 +2243,10 @@ def run_ocr(page_selection: str = "", page_exclusion: str = "", replace_book_que
2243
  img.close()
2244
  except Exception:
2245
  pass
 
 
 
 
2246
 
2247
  log.append(log_line(f" → {book_id}: batch OCR complete — building review queue"))
2248
  yield _ocr_status_html(), "\n".join(log) # stream: batch OCR done
 
2243
  img.close()
2244
  except Exception:
2245
  pass
2246
+ # Stream progress after each batch
2247
+ done_pages = min(start + batch_size, len(ocr_targets))
2248
+ log.append(log_line(f" ✓ {book_id}: batch {start//batch_size + 1} complete ({done_pages}/{len(ocr_targets)} pages)"))
2249
+ yield _ocr_status_html(), "\n".join(log)
2250
 
2251
  log.append(log_line(f" → {book_id}: batch OCR complete — building review queue"))
2252
  yield _ocr_status_html(), "\n".join(log) # stream: batch OCR done