diff --git a/kischdle/llmux/scripts/download_models.sh b/kischdle/llmux/scripts/download_models.sh index facefad..e6da9dc 100755 --- a/kischdle/llmux/scripts/download_models.sh +++ b/kischdle/llmux/scripts/download_models.sh @@ -1,15 +1,26 @@ #!/bin/bash # Download all model weights for llmux. # Run as user llm: bash scripts/download_models.sh -# Requires: pip install huggingface_hub # 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" @@ -19,14 +30,14 @@ download_hf() { return fi echo "Downloading: $repo" - huggingface-cli download "$repo" --cache-dir "$MODELS_DIR" + "$HF_CLI" download "$repo" --cache-dir "$MODELS_DIR" } download_hf_files() { local repo="$1" shift echo "Downloading specific files from: $repo" - huggingface-cli download "$repo" "$@" --cache-dir "$MODELS_DIR" + "$HF_CLI" download "$repo" "$@" --cache-dir "$MODELS_DIR" } # 1. Qwen3.5-9B-FP8 @@ -53,7 +64,7 @@ download_hf "CohereLabs/cohere-transcribe-03-2026" || \ # 7. Chatterbox TTS echo "Downloading: Chatterbox TTS weights (auto-downloaded by library)" -python3 -c " +"$PYTHON" -c " from chatterbox.tts import ChatterboxTTS import os os.environ['CUDA_VISIBLE_DEVICES'] = ''