Spaces:
Running on Zero
Running on Zero
Commit History
-
Turn the TrOCR demo into an agentic document pipeline
Sanidhya RaviThe Space did not run. `from_pretrained(".")` loads weights from the repo root, but no model files were ever committed -- git history shows only .gitattributes, README.md, app.py and requirements.txt, and the live Space holds the same four. It crashed on boot. TrOCR now loads from the Hub. Beyond that fix, the demo becomes an agent: drop in any document, optionally say what you want, and it works out what the document is, reads it with the right model, and writes the structured output that suits it -- a spreadsheet for tabular data, JSON for a form, a summary PDF for prose. The same tools are published over MCP so external agents can call the Space directly. Pipeline: ingest -> read -> classify -> tables -> route or plan -> export. * ingest.py takes images, multi-frame TIFF, HEIC, PDF, DOCX, PPTX, XLSX, text and ZIP. pypdfium2 bundles its own PDFium, so no poppler/packages.txt. * Pages arriving with a text layer are used as-is and never reach the GPU. * router.py settles unambiguo…5eb40dc