Pointf5ive commited on
Commit
2d9935c
·
1 Parent(s): 7ccec5a

Add debug output to OCR step

Browse files
Files changed (1) hide show
  1. smoke_signal_tab.py +8 -2
smoke_signal_tab.py CHANGED
@@ -683,12 +683,18 @@ def _profile_status_html() -> str:
683
  def run_ocr() -> tuple:
684
  """Run Surya OCR on all profiled PDFs."""
685
  df = load_manifest_df()
 
 
 
 
 
 
686
  if df.empty:
687
- return _ocr_status_html(), "No sources. Complete Steps 1-2 first."
688
 
689
  eligible = df[df["status"] == "profiled"]
690
  if eligible.empty:
691
- return _ocr_status_html(), "No profiled PDFs. Complete Step 2 first."
692
 
693
  log = []
694
 
 
683
  def run_ocr() -> tuple:
684
  """Run Surya OCR on all profiled PDFs."""
685
  df = load_manifest_df()
686
+ debug = f"[DEBUG] SS_ROOT={SS_ROOT}\nMANIFEST_CSV={MANIFEST_CSV}\nCSV exists={MANIFEST_CSV.exists()}\n"
687
+ if not df.empty:
688
+ debug += f"Manifest rows={len(df)}\nStatuses={df['status'].value_counts().to_dict()}\n"
689
+ else:
690
+ debug += "Manifest is EMPTY\n"
691
+
692
  if df.empty:
693
+ return _ocr_status_html(), debug + "No sources. Complete Steps 1-2 first."
694
 
695
  eligible = df[df["status"] == "profiled"]
696
  if eligible.empty:
697
+ return _ocr_status_html(), debug + "No profiled PDFs. Complete Step 2 first."
698
 
699
  log = []
700