Download setup_envs.sh from lidavidsh/vggt: direct link, hf CLI and curl.
- Browser
- Download file 1.49 kB
-
https://huggingface.co/spaces/lidavidsh/vggt/resolve/main/setup_envs.sh
- Command line
-
hf download hf://spaces/lidavidsh/vggt/setup_envs.sh
-
curl -L -o setup_envs.sh https://huggingface.co/spaces/lidavidsh/vggt/resolve/main/setup_envs.sh
1.49 kB
| # Script to verify PyTorch dependencies in Docker container | |
| # This script checks existing PyTorch/numpy versions and modifies requirements_api.txt | |
| # to avoid reinstalling them, using the base image versions instead. | |
| set -e | |
| echo "=== Starting dependency verification script ===" | |
| # Check existing PyTorch and numpy | |
| echo "=== Checking existing PyTorch and numpy ===" | |
| python3 -c "import torch; import torchvision; import numpy; print(f'Existing torch: {torch.__version__}, torchvision: {torchvision.__version__}, numpy: {numpy.__version__}')" || echo "check failed" | |
| # Verify requirements_api.txt exists | |
| if [ ! -f "requirements_api.txt" ]; then | |
| echo "ERROR: requirements_api.txt not found in current directory" | |
| exit 1 | |
| fi | |
| echo "=== Original requirements_api.txt ===" | |
| cat requirements_api.txt | |
| # Modify requirements to remove torch, torchvision, and numpy (to use system versions) | |
| echo "=== Modifying requirements_api.txt to remove torch, torchvision, and numpy ===" | |
| sed -i '/^torch==/d' requirements_api.txt | |
| sed -i '/^torch>=/d' requirements_api.txt | |
| sed -i '/^torch$/d' requirements_api.txt | |
| sed -i '/^torchvision/d' requirements_api.txt | |
| sed -i '/^numpy/d' requirements_api.txt | |
| echo "=== Modified requirements_api.txt ===" | |
| cat requirements_api.txt | |
| # Install modified requirements | |
| echo "=== Installing modified requirements ===" | |
| pip install --no-cache-dir --ignore-installed blinker -r requirements_api.txt | |
| echo "=== Dependency verification completed successfully ===" | |