Suya OCR API — vLLM-backed, OpenAI-compatible OCR service
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>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
from scripts.quant.serve import health_url, parse_listening_pid
|
||||
|
||||
|
||||
def test_health_url_from_port():
|
||||
assert health_url(8001) == "http://127.0.0.1:8001/health"
|
||||
|
||||
|
||||
def test_parse_listening_pid_extracts_from_ss_line():
|
||||
ss_output = (
|
||||
'LISTEN 0 4096 127.0.0.1:8001 0.0.0.0:* users:(("python",pid=12345,fd=7))\n'
|
||||
)
|
||||
assert parse_listening_pid(ss_output, 8001) == 12345
|
||||
|
||||
|
||||
def test_parse_listening_pid_returns_none_when_absent():
|
||||
assert parse_listening_pid("LISTEN 0 4096 127.0.0.1:9999 0.0.0.0:*\n", 8001) is None
|
||||
Reference in New Issue
Block a user