27 lines
1.0 KiB
Bash
27 lines
1.0 KiB
Bash
#!/usr/bin/env bash
|
|
# Download small GGUF coder models (weights only; KV is computed at runtime).
|
|
set -euo pipefail
|
|
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/env.sh"
|
|
cd "$MODELS_DIR"
|
|
|
|
dl() { # name url
|
|
local out="$1" url="$2"
|
|
if [ -f "$out" ] && [ "$(stat -c%s "$out")" -gt 100000000 ]; then
|
|
echo "[model] have $out ($(du -h "$out" | cut -f1))"; return 0
|
|
fi
|
|
echo "[model] downloading $out"
|
|
curl -fL --retry 4 --retry-delay 3 -o "$out.part" "$url"
|
|
mv "$out.part" "$out"
|
|
echo "[model] done $out ($(du -h "$out" | cut -f1))"
|
|
}
|
|
|
|
# 1.5B for fast iteration, 7B for the main results (bigger KV => bigger transfer win).
|
|
dl qwen2.5-coder-1.5b-instruct-q4_k_m.gguf \
|
|
"https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF/resolve/main/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf"
|
|
|
|
if [ "${1:-}" = "--with-7b" ]; then
|
|
dl qwen2.5-coder-7b-instruct-q4_k_m.gguf \
|
|
"https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF/resolve/main/qwen2.5-coder-7b-instruct-q4_k_m.gguf"
|
|
fi
|
|
ls -la "$MODELS_DIR"
|