update
Browse files- setup_envs.sh +15 -15
setup_envs.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
# Script to verify PyTorch dependencies in Docker container
|
| 4 |
-
# This script checks existing PyTorch/numpy versions and modifies
|
| 5 |
# to avoid reinstalling them, using the base image versions instead.
|
| 6 |
|
| 7 |
set -e
|
|
@@ -12,28 +12,28 @@ echo "=== Starting dependency verification script ==="
|
|
| 12 |
echo "=== Checking existing PyTorch and numpy ==="
|
| 13 |
python3 -c "import torch; import torchvision; import numpy; print(f'Existing torch: {torch.__version__}, torchvision: {torchvision.__version__}, numpy: {numpy.__version__}')" || echo "check failed"
|
| 14 |
|
| 15 |
-
# Verify
|
| 16 |
-
if [ ! -f "
|
| 17 |
-
echo "ERROR:
|
| 18 |
exit 1
|
| 19 |
fi
|
| 20 |
|
| 21 |
-
echo "=== Original
|
| 22 |
-
cat
|
| 23 |
|
| 24 |
# Modify requirements to remove torch, torchvision, and numpy (to use system versions)
|
| 25 |
-
echo "=== Modifying
|
| 26 |
-
sed -i '/^torch==/d'
|
| 27 |
-
sed -i '/^torch>=/d'
|
| 28 |
-
sed -i '/^torch$/d'
|
| 29 |
-
sed -i '/^torchvision/d'
|
| 30 |
-
sed -i '/^numpy/d'
|
| 31 |
|
| 32 |
-
echo "=== Modified
|
| 33 |
-
cat
|
| 34 |
|
| 35 |
# Install modified requirements
|
| 36 |
echo "=== Installing modified requirements ==="
|
| 37 |
-
pip install --no-cache-dir --ignore-installed blinker -r
|
| 38 |
|
| 39 |
echo "=== Dependency verification completed successfully ==="
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
# Script to verify PyTorch dependencies in Docker container
|
| 4 |
+
# This script checks existing PyTorch/numpy versions and modifies requirements_api.txt
|
| 5 |
# to avoid reinstalling them, using the base image versions instead.
|
| 6 |
|
| 7 |
set -e
|
|
|
|
| 12 |
echo "=== Checking existing PyTorch and numpy ==="
|
| 13 |
python3 -c "import torch; import torchvision; import numpy; print(f'Existing torch: {torch.__version__}, torchvision: {torchvision.__version__}, numpy: {numpy.__version__}')" || echo "check failed"
|
| 14 |
|
| 15 |
+
# Verify requirements_api.txt exists
|
| 16 |
+
if [ ! -f "requirements_api.txt" ]; then
|
| 17 |
+
echo "ERROR: requirements_api.txt not found in current directory"
|
| 18 |
exit 1
|
| 19 |
fi
|
| 20 |
|
| 21 |
+
echo "=== Original requirements_api.txt ==="
|
| 22 |
+
cat requirements_api.txt
|
| 23 |
|
| 24 |
# Modify requirements to remove torch, torchvision, and numpy (to use system versions)
|
| 25 |
+
echo "=== Modifying requirements_api.txt to remove torch, torchvision, and numpy ==="
|
| 26 |
+
sed -i '/^torch==/d' requirements_api.txt
|
| 27 |
+
sed -i '/^torch>=/d' requirements_api.txt
|
| 28 |
+
sed -i '/^torch$/d' requirements_api.txt
|
| 29 |
+
sed -i '/^torchvision/d' requirements_api.txt
|
| 30 |
+
sed -i '/^numpy/d' requirements_api.txt
|
| 31 |
|
| 32 |
+
echo "=== Modified requirements_api.txt ==="
|
| 33 |
+
cat requirements_api.txt
|
| 34 |
|
| 35 |
# Install modified requirements
|
| 36 |
echo "=== Installing modified requirements ==="
|
| 37 |
+
pip install --no-cache-dir --ignore-installed blinker -r requirements_api.txt
|
| 38 |
|
| 39 |
echo "=== Dependency verification completed successfully ==="
|