Added correct python path to the startup script
Browse files- start_server.sh +11 -1
start_server.sh
CHANGED
|
@@ -2,8 +2,18 @@
|
|
| 2 |
set -ex
|
| 3 |
echo "--- Starting setup and server ---"
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
python3 - <<'PY'
|
| 6 |
import sys, os
|
|
|
|
| 7 |
print("PYTHONPATH:", sys.path)
|
| 8 |
import modeling_dots_ocr_vllm
|
| 9 |
print("DotsOCR import OK")
|
|
@@ -17,4 +27,4 @@ exec vllm serve ${HF_MODEL_PATH} \
|
|
| 17 |
--gpu-memory-utilization 0.8 \
|
| 18 |
--chat-template-content-format string \
|
| 19 |
--served-model-name dotsocr-model \
|
| 20 |
-
--trust-remote-code
|
|
|
|
| 2 |
set -ex
|
| 3 |
echo "--- Starting setup and server ---"
|
| 4 |
|
| 5 |
+
# Use the exact snapshot path resolved at build time so Python can import the model code.
|
| 6 |
+
# The HF cache's model root doesn't contain the files; they're under snapshots/<commit>.
|
| 7 |
+
HF_MODEL_PATH_FILE="/home/user/app/model_path.txt"
|
| 8 |
+
if [ -f "$HF_MODEL_PATH_FILE" ]; then
|
| 9 |
+
export HF_MODEL_PATH="$(cat "$HF_MODEL_PATH_FILE")"
|
| 10 |
+
fi
|
| 11 |
+
# Ensure Python sees the model's modules (e.g., modeling_dots_ocr_vllm.py).
|
| 12 |
+
export PYTHONPATH="${HF_MODEL_PATH}:${PYTHONPATH}"
|
| 13 |
+
|
| 14 |
python3 - <<'PY'
|
| 15 |
import sys, os
|
| 16 |
+
print("HF_MODEL_PATH:", os.environ.get("HF_MODEL_PATH"))
|
| 17 |
print("PYTHONPATH:", sys.path)
|
| 18 |
import modeling_dots_ocr_vllm
|
| 19 |
print("DotsOCR import OK")
|
|
|
|
| 27 |
--gpu-memory-utilization 0.8 \
|
| 28 |
--chat-template-content-format string \
|
| 29 |
--served-model-name dotsocr-model \
|
| 30 |
+
--trust-remote-code
|