#!/usr/bin/env bash # One-time setup on the training machine. Everything lives under /data/train; the host # system is not changed (no apt, nothing outside /data/train except Docker's own image store). set -euo pipefail ROOT=/data/train export HF_HOME=$ROOT/hf PIP_CACHE_DIR=$ROOT/pipcache HF_HUB_DISABLE_TELEMETRY=1 cd $ROOT [ -d venv ] || python3 -m venv venv . venv/bin/activate pip install -q --upgrade pip pip install -q torch torchaudio numpy scipy aiohttp librosa safetensors huggingface_hub soundfile s3tokenizer onnxruntime hyperpyyaml # Kokoro without its GPL / LGPL dependencies: tools/kokoro_stubs stands in for them pip install -q --no-deps kokoro misaki pip install -q spacy loguru addict regex transformers echo "$ROOT/duplex/tools/kokoro_stubs" > "$(python -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')/duplex_kokoro_stubs.pth" python -c 'import torch; print("torch", torch.__version__, "cuda", torch.version.cuda, torch.cuda.get_device_name(3)); x = torch.randn(2048, 2048, device="cuda:3"); print("gpu matmul ok", float((x @ x).abs().mean()))' [ -d src/Step-Audio2 ] || git clone -q https://github.com/stepfun-ai/Step-Audio2 src/Step-Audio2 echo "Step-Audio2 commit $(git -C src/Step-Audio2 rev-parse HEAD)" hf download stepfun-ai/Step-Audio-2-mini --include 'token2wav/*' --local-dir models/Step-Audio-2-mini > /dev/null echo TOKEN2WAV_DONE hf download stepfun-ai/Step-Audio-R1.1 --local-dir models/Step-Audio-R1.1 > /dev/null & hf download Qwen/Qwen3-32B --local-dir models/Qwen3-32B > /dev/null & wait echo SETUP_DONE