Download other_transfer/scripts/train_sft_4gpu.sh from hk239/PhysVLM: direct link, hf CLI and curl.
- Browser
- Download file 991 Bytes
-
https://huggingface.co/datasets/hk239/PhysVLM/resolve/main/other_transfer/scripts/train_sft_4gpu.sh
- Command line
-
hf download hf://datasets/hk239/PhysVLM/other_transfer/scripts/train_sft_4gpu.sh
-
curl -L -o train_sft_4gpu.sh https://huggingface.co/datasets/hk239/PhysVLM/resolve/main/other_transfer/scripts/train_sft_4gpu.sh
991 Bytes
| # Interactive 4xH100 LoRA SFT. Run this on the compute node, not the login node. | |
| # Effective batch = 1 * 8 * 4 = 32 | |
| set -euo pipefail | |
| ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | |
| cd "$ROOT" | |
| export PYTHONPATH="$ROOT/src${PYTHONPATH:+:$PYTHONPATH}" | |
| export HF_HOME="${HF_HOME:-$ROOT/.cache/huggingface}" | |
| export TOKENIZERS_PARALLELISM=false | |
| export PYTHONUNBUFFERED=1 | |
| if [[ -n "${PHYSICS_SFT_CONDA_ENV:-}" ]]; then | |
| # shellcheck disable=SC1091 | |
| source ~/.bashrc | |
| conda activate "$PHYSICS_SFT_CONDA_ENV" | |
| elif [[ -x "$ROOT/.venv/bin/python" ]]; then | |
| # shellcheck disable=SC1091 | |
| source "$ROOT/.venv/bin/activate" | |
| fi | |
| PYTHON="$(command -v python)" | |
| echo "cwd=$(pwd) python=$PYTHON CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-all}" | |
| nvidia-smi -L || true | |
| "$PYTHON" -m accelerate.commands.launch --num_processes 4 \ | |
| --config_file configs/accelerate_ddp_4gpu.yaml \ | |
| src/physics_model/sft.py --config configs/sft_qwen25vl_7b_4gpu.yaml \ | |
| --skip-length-scan | |