#!/usr/bin/env bash
set -euo pipefail
BASE="${BASE:-http://dmit2.677845.xyz/Qwen3.5-27B}"
DEST="${DEST:-/home/sysadmin/models/Qwen3.5-27B}"
mkdir -p "$DEST"
cd "$DEST"
small_files=(
  config.json
  tokenizer.json
  tokenizer_config.json
  chat_template.jinja
  model.safetensors.index.json
  files.txt
  SHA256SUMS.txt
)
for f in "${small_files[@]}"; do
  echo "download $f"
  wget -c "$BASE/$f" -O "$f"
done
while IFS= read -r f; do
  [ -z "$f" ] && continue
  echo "download $f"
  wget -c "$BASE/$f" -O "$f"
done < files.txt
sha256sum -c SHA256SUMS.txt
