@@ -12,10 +12,9 @@ REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
1212TARGET=" ${1:- $REPO_ROOT / models} "
1313
1414MODEL_DIR=" $TARGET /Qwen3-0.6B-q4f16_1-MLC"
15- WASM_FILE=" $TARGET /Qwen3-0.6B-q4f16_1-ctx4k_cs1k-webgpu.wasm"
1615
1716HF_BASE=" https://huggingface.co/mlc-ai/Qwen3-0.6B-q4f16_1-MLC/resolve/main"
18- WASM_URL= " https://huggingface.co/mlc-ai/binary-mlc-llm-libs/resolve/main/ Qwen3-0.6B-q4f16_1-ctx4k_cs1k-webgpu.wasm"
17+ WASM_NAME= " Qwen3-0.6B-q4f16_1-ctx4k_cs1k-webgpu.wasm"
1918
2019# Files to download from the HuggingFace model repo
2120MODEL_FILES=(
@@ -50,12 +49,20 @@ for file in "${MODEL_FILES[@]}"; do
5049 fi
5150done
5251
53- # Download WASM
54- if [ -f " $WASM_FILE " ]; then
55- echo " [cached] $( basename " $WASM_FILE " ) "
52+ # The WASM file is committed to git (not available from a public URL).
53+ # In CI / Docker, it comes from the git checkout or COPY step.
54+ if [ ! -f " $TARGET /$WASM_NAME " ]; then
55+ # Try to find it in the repo checkout (for CI/Docker contexts)
56+ REPO_WASM=" $REPO_ROOT /models/$WASM_NAME "
57+ if [ -f " $REPO_WASM " ]; then
58+ echo " [copy] $WASM_NAME (from repo)"
59+ cp " $REPO_WASM " " $TARGET /$WASM_NAME "
60+ else
61+ echo " [ERROR] $WASM_NAME not found. Ensure the repo checkout includes it."
62+ exit 1
63+ fi
5664else
57- echo " [downloading] $( basename " $WASM_FILE " ) "
58- curl -fSL --retry 3 " $WASM_URL " -o " $WASM_FILE "
65+ echo " [cached] $WASM_NAME "
5966fi
6067
6168echo " ==> Model download complete"
0 commit comments