mocr-inference / simple_server.py
LordLP9000's picture
Upload folder using huggingface_hub
1aa12c7 verified
raw
history blame contribute delete
524 Bytes
#!/usr/bin/env python3
"""Simple OCR server using vLLM for dots.mocr model"""
import os
import subprocess
# Configuration
MODEL_PATH = os.environ.get('MODEL_PATH', 'rednote-hilab/dots.mocr-svg')
PORT = int(os.environ.get('PORT', 7860))
# Start vLLM server directly
subprocess.run([
"vllm", "serve", MODEL_PATH,
"--port", str(PORT),
"--host", "0.0.0.0",
"--tensor-parallel-size", "1",
"--gpu-memory-utilization", "0.8",
"--max-model-len", "4096",
"--enforce-eager",
"--trust-remote-code"
])