#!/bin/bash # 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 # NOTE: Import directly from the model folder on PYTHONPATH, not from a non-existent 'DotsOCR' package sed -i '/^from vllm\.entrypoints\.cli\.main import main$/a\ 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!"