citationEdge / _debug_viz.py
omkarkudalkar222's picture
deploy: full CitationEdge update (text detection, report UI, fixes) for HF Spaces
497f49b
Raw
History Blame Contribute Delete
846 Bytes
"""Debug visual parser for latest job."""
import sys, json, urllib.request
r = urllib.request.urlopen("http://localhost:8003/reports/job_9f7f378b/json")
d = json.loads(r.read())
raw = d.get("raw", {})
agents = raw.get("agents", {})
vis = agents.get("visual_parser", {})
print(f"Visual parser: status={vis.get('status')} duration={vis.get('duration_s')}s error={vis.get('error')}")
figures = raw.get("figures", [])
print(f"Figures in raw: {len(figures)}")
figure_count = raw.get("figure_count", 0)
print(f"Figure count: {figure_count}")
# Check the job log for visual parser details
r2 = urllib.request.urlopen("http://localhost:8003/jobs/job_9f7f378b")
job = json.loads(r2.read())
print(f"\nJob status: {job.get('status')}")
events = job.get("events", [])
for ev in events:
if "visual" in str(ev).lower():
print(f" Event: {ev}")