| # patch_vllm.sh | |
| # Patches the vLLM entrypoint to register the DotsOCR model | |
| set -e | |
| echo "Patching vLLM entrypoint to register DotsOCR model..." | |
| # Patch the vLLM script to import the DotsOCR modeling code | |
| # Import via the DotsOCR package so relative imports inside the module resolve | |
| sed -i '/^from vllm\.entrypoints\.cli\.main import main$/a\ | |
| from DotsOCR import modeling_dots_ocr_vllm' $(which vllm) | |
| echo "vLLM script after patch:" | |
| grep -A 1 'from vllm.entrypoints.cli.main import main' $(which vllm) | |
| echo "vLLM patching completed successfully!" |