File size: 986 Bytes
a64600b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #!/usr/bin/env bash
# Host-side launcher. Reuse installed environments and weights; replace code by mounts.
set -euo pipefail
SNF_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SNF_STORAGE="${SNF_STORAGE:-$SNF_ROOT/runtime}"
mkdir -p "$SNF_STORAGE/outputs"
if [ ! -d "$SNF_STORAGE/weights" ]; then
printf '%s\n' 'Set SNF_STORAGE to the existing directory containing weights/ and outputs/.' >&2
exit 2
fi
SNF_STORAGE="$(cd "$SNF_STORAGE" && pwd)"
docker run --rm --gpus all --ipc=host --init \
-e HF_TOKEN -e HF_ENDPOINT \
-e "SNF_V2_GPUS=${SNF_V2_GPUS:-0,1,2,3,4,5,6,7}" \
-e "SNF_V2_MODELS=${SNF_V2_MODELS:-meissonic,showo,momask}" \
-e "SNF_V2_OUTPUT=${SNF_V2_OUTPUT:-/outputs/method-v2}" \
-v "$SNF_STORAGE/weights:/weights" \
-v "$SNF_STORAGE/outputs:/outputs" \
-v "$SNF_ROOT/suite:/opt/snf/suite:ro" \
-v "$SNF_ROOT/packaging:/opt/snf/packaging:ro" \
--entrypoint /bin/bash "${SNF_IMAGE:-snf-five-models:cu128}" \
/opt/snf/packaging/run_method_v2.sh "${1:-all}"
|