Download setup_env.sh from xiaohaoy/ViewingSoundPAQ: direct link, hf CLI and curl.
- Browser
- Download file 1.4 kB
-
https://huggingface.co/xiaohaoy/ViewingSoundPAQ/resolve/main/setup_env.sh
- Command line
-
hf download hf://xiaohaoy/ViewingSoundPAQ/setup_env.sh
-
curl -L -o setup_env.sh https://huggingface.co/xiaohaoy/ViewingSoundPAQ/resolve/main/setup_env.sh
1.4 kB
| # Linux/macOS setup: conda env + PyTorch + this package (editable) + ImageBind dependencies. | |
| # Usage: ./setup_env.sh [env-name] [torch-backend: cu126|cu128|cu130|cpu] [--download-imagebind] | |
| set -euo pipefail | |
| cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| ENV_NAME="${1:-viewing-sound-paq}"; BACKEND="${2:-cu126}"; DL="${3:-}" | |
| command -v conda >/dev/null || { echo "conda not found" >&2; exit 1; } | |
| if conda env list | awk '{print $1}' | grep -Fxq "$ENV_NAME"; then conda env update -n "$ENV_NAME" -f environment.yml; else conda env create -n "$ENV_NAME" -f environment.yml; fi | |
| conda run -n "$ENV_NAME" python -m pip install --upgrade torch torchvision torchaudio --index-url "https://download.pytorch.org/whl/${BACKEND}" | |
| conda run -n "$ENV_NAME" python -m pip install "git+https://github.com/facebookresearch/pytorchvideo.git@6cdc929315aab1b5674b6dcf73b16ec99147735f" | |
| conda run -n "$ENV_NAME" python -m pip install -e ".[dev]" | |
| if [[ "$DL" == "--download-imagebind" ]]; then | |
| mkdir -p checkpoints; [[ -f checkpoints/imagebind_huge.pth ]] || curl -L -o checkpoints/imagebind_huge.pth https://dl.fbaipublicfiles.com/imagebind/imagebind_huge.pth | |
| fi | |
| if [[ "$BACKEND" == cpu ]]; then conda run -n "$ENV_NAME" python scripts/common/check_environment.py; else conda run -n "$ENV_NAME" python scripts/common/check_environment.py --require-cuda; fi | |
| echo "Ready: conda activate $ENV_NAME" | |