FastAPI service wrapping the Surya-OCR-2 model (datalab-to) served through vLLM: legacy /v1/api/ai/* endpoints, an OpenAI-compatible /v1/chat/completions endpoint, a coalescing request batcher, a local OCR CLI, Docker packaging, multilingual example outputs, and quantization/concurrency benchmarks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
19 lines
628 B
Python
19 lines
628 B
Python
"""Load the fixed eval-set manifest (one image filename per line)."""
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
from typing import List
|
|
|
|
|
|
def load_manifest(manifest_path: Path, image_root: Path) -> List[Path]:
|
|
paths: List[Path] = []
|
|
for raw in manifest_path.read_text(encoding="utf-8").splitlines():
|
|
name = raw.strip()
|
|
if not name or name.startswith("#"):
|
|
continue
|
|
image = image_root / name
|
|
if not image.exists():
|
|
raise FileNotFoundError(f"manifest image not found: {name} (looked in {image_root})")
|
|
paths.append(image)
|
|
return paths
|