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>
20 lines
414 B
Python
20 lines
414 B
Python
class FakeFuture:
|
|
def __init__(self, func, *args, **kwargs):
|
|
self._result = func(*args, **kwargs)
|
|
|
|
def result(self):
|
|
return self._result
|
|
|
|
class FakeExecutor:
|
|
def __init__(self, **kwargs):
|
|
pass
|
|
|
|
def __enter__(self):
|
|
return self
|
|
|
|
def __exit__(self, *excinfo):
|
|
pass
|
|
|
|
def submit(self, fn, *args, **kwargs):
|
|
return FakeFuture(fn, *args, **kwargs)
|