mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-11-11 13:51:01 +08:00
PaddleOCR could only reach the hosted AI Studio service, whose asynchronous job API (submit -> poll -> fetch) is unreachable in an air-gapped install. A self-hosted PaddleOCR-VL exposes a PaddleX pipeline that answers a single request synchronously instead; the two protocols share nothing but the result schema. Pick the protocol from the configured address rather than adding a second provider, so existing configurations keep working and only the URL decides: just paddleocr.aistudio-app.com serves the job API, and any other host gets the synchronous /layout-parsing call. The address is compared by hostname, so an AI Studio deployment on a sibling subdomain is routed to the synchronous pipeline while a lookalike domain is not mistaken for the hosted service. Self-hosted deployments usually run unauthenticated, so the access token is now required only for the hosted service. Fix two defects this exposed on the way: - A block whose content is nothing but a markdown image became an empty section carrying a position tag, because emptiness was tested before the images were stripped. Scanned pages that the layout model labels as one image block hit this on every page. - HTTP, JSON and errorCode failures on the synchronous path never reached the callback, so a wrong path or a rejected token left the document at zero chunks with no visible cause. Closes #18757