Download 14B/scripts/train.sh from Elastic-forcing/Elastic-forcing-code: direct link, hf CLI and curl.
- Browser
- Download file 758 Bytes
-
https://huggingface.co/Elastic-forcing/Elastic-forcing-code/resolve/main/14B/scripts/train.sh
- Command line
-
hf download hf://Elastic-forcing/Elastic-forcing-code/14B/scripts/train.sh
-
curl -L -o train.sh https://huggingface.co/Elastic-forcing/Elastic-forcing-code/resolve/main/14B/scripts/train.sh
758 Bytes
| set -euo pipefail | |
| source "$(dirname "${BASH_SOURCE[0]}")/common.sh" | |
| extra_args=() | |
| case "${1:-}" in | |
| "") ;; | |
| --smoke) extra_args=(--max_steps 1) ;; | |
| *) echo 'Usage: scripts/train.sh [--smoke]' >&2; exit 2 ;; | |
| esac | |
| [[ $# -le 1 ]] || { echo 'Too many arguments' >&2; exit 2; } | |
| export CUDA_VISIBLE_DEVICES="${GPUS:-${CUDA_VISIBLE_DEVICES:-0,1,2,3,4,5,6,7}}" | |
| LOGDIR="$(realpath -m "${LOGDIR:-$REPRO_ROOT/runs/three-encoder}")" | |
| mkdir -p "$LOGDIR" | |
| cp "$CONFIG" "$LOGDIR/config.yaml" | |
| cd "$REPRO_ROOT/code" | |
| "$PYTHON_BIN" -m torch.distributed.run --standalone --nnodes=1 --nproc-per-node=8 train.py \ | |
| --config_path "$LOGDIR/config.yaml" --logdir "$LOGDIR" \ | |
| --disable-wandb --no_visualize "${extra_args[@]}" 2>&1 | tee -a "$LOGDIR/train.log" | |