ocr-mt-5090 / scripts /prefetch.sh
mohameddalii's picture
OCR + Qwen3-4B RTX 5090 colocated serve kit
ba8abef verified
Raw History Blame Contribute Delete
587 Bytes
#!/usr/bin/env bash
# Prefetch both model repos into HF_HOME so the first vLLM start is local.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
export HF_HOME="${HF_HOME:-${ROOT}/.hf_home}"
if [[ -f "${VENV:-$ROOT/.venv}/bin/activate" ]]; then
# shellcheck disable=SC1091
source "${VENV:-$ROOT/.venv}/bin/activate"
fi
python3 - <<'PY'
from huggingface_hub import snapshot_download
for repo in ("Qwen/Qwen3-4B-Instruct-2507", "PaddlePaddle/PaddleOCR-VL"):
print("fetching", repo)
snapshot_download(repo, resume_download=True)
print("ok", repo)
PY