Files
DesTEngSsv006_swd/kischdle/llmux/scripts/download_models.sh
2026-04-05 12:52:09 +02:00

84 lines
2.6 KiB
Bash
Executable File

#!/bin/bash
# Download all model weights for llmux.
# Run as user llm: bash scripts/download_models.sh
# Requires: HuggingFace token at ~/.cache/huggingface/token for gated models
set -euo pipefail
# Use llm user's venv for huggingface-cli and python
VENV="${LLMUX_VENV:-$HOME/.venv-pytorch}"
HF_CLI="${VENV}/bin/huggingface-cli"
PYTHON="${VENV}/bin/python"
if [ ! -x "$HF_CLI" ]; then
echo "ERROR: huggingface-cli not found at $HF_CLI"
echo "Install with: ${VENV}/bin/pip install huggingface_hub"
exit 1
fi
MODELS_DIR="${LLMUX_MODELS_DIR:-$HOME/.local/share/llmux_pod/models}"
mkdir -p "$MODELS_DIR"
echo "=== Downloading models to $MODELS_DIR ==="
echo "Using: $HF_CLI"
download_hf() {
local repo="$1"
local target="$MODELS_DIR/models--${repo//\//-}"
if [ -d "$target" ]; then
echo "SKIP: $repo (already downloaded)"
return
fi
echo "Downloading: $repo"
"$HF_CLI" download "$repo" --cache-dir "$MODELS_DIR"
}
download_hf_files() {
local repo="$1"
shift
echo "Downloading specific files from: $repo"
"$HF_CLI" download "$repo" "$@" --cache-dir "$MODELS_DIR"
}
# 1. Qwen3.5-9B-FP8
download_hf "lovedheart/Qwen3.5-9B-FP8"
# 2. Qwen3.5-9B-FP8-Uncensored (GGUF files only)
download_hf_files "HauhauCS/Qwen3.5-9B-Uncensored-HauhauCS-Aggressive" \
"Qwen3.5-9B-Uncensored-HauhauCS-Aggressive-Q8_0.gguf" \
"mmproj-Qwen3.5-9B-Uncensored-HauhauCS-Aggressive-BF16.gguf"
# 3. Qwen3.5-4B
download_hf "Qwen/Qwen3.5-4B"
# 4. gpt-oss-20b
download_hf "openai/gpt-oss-20b"
# 5. gpt-oss-20b-uncensored
download_hf "aoxo/gpt-oss-20b-uncensored"
# 6. cohere-transcribe (gated — requires accepted terms)
echo "Downloading: CohereLabs/cohere-transcribe-03-2026 (gated)"
download_hf "CohereLabs/cohere-transcribe-03-2026" || \
echo "WARNING: cohere-transcribe download failed. Have you accepted the terms at https://huggingface.co/CohereLabs/cohere-transcribe-03-2026 ?"
# 7. Chatterbox TTS
echo "Downloading: Chatterbox TTS weights (auto-downloaded by library)"
"$PYTHON" -c "
from chatterbox.tts import ChatterboxTTS
import os
os.environ['CUDA_VISIBLE_DEVICES'] = ''
print('Downloading Chatterbox default...')
ChatterboxTTS.from_pretrained(device='cpu')
print('Downloading Chatterbox turbo...')
ChatterboxTTS.from_pretrained(device='cpu', variant='turbo')
print('Downloading Chatterbox multilingual...')
ChatterboxTTS.from_pretrained(device='cpu', variant='multilingual')
print('Chatterbox downloads complete.')
" || echo "WARNING: Chatterbox download failed. Check chatterbox-tts installation."
echo ""
echo "=== Download complete ==="
echo "Models directory: $MODELS_DIR"
du -sh "$MODELS_DIR"