final attempt
Browse files
app.py
CHANGED
|
@@ -4,6 +4,11 @@ from subprocess import getoutput
|
|
| 4 |
# Welcome to the world of python madness!
|
| 5 |
|
| 6 |
# Debugging with Verbose mode on...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
os.system(f'echo "Checking Python Version"')
|
| 8 |
os.system(f"python --version")
|
| 9 |
|
|
@@ -105,11 +110,18 @@ else:
|
|
| 105 |
# Critical dependency installation sequence
|
| 106 |
os.system(f'echo "starting dependency cleanup..."')
|
| 107 |
os.system(f'pip cache purge')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
# Force NumPy 1.26.4 first
|
| 110 |
os.system(f'echo "Installing NumPy 1.26.4..."')
|
| 111 |
os.system(f"pip install --no-cache-dir numpy==1.26.4")
|
| 112 |
|
|
|
|
|
|
|
|
|
|
| 113 |
# Install PyTorch + xformers with CUDA compatibility
|
| 114 |
os.system(f'echo "Installing PyTorch..."')
|
| 115 |
os.system(f"pip install torch==2.1.2+cu121 torchvision==0.16.2+cu121 --extra-index-url https://download.pytorch.org/whl/cu121 ")
|
|
@@ -119,7 +131,7 @@ else:
|
|
| 119 |
|
| 120 |
# Final verification
|
| 121 |
os.system(f'echo "Verifying NumPy, PyTorch, and xformers versions..."')
|
| 122 |
-
|
| 123 |
os.system(f"python -c 'import torch; print(torch.__version__)'")
|
| 124 |
os.system(f"python -c 'import xformers; print(xformers.__version__)")
|
| 125 |
|
|
|
|
| 4 |
# Welcome to the world of python madness!
|
| 5 |
|
| 6 |
# Debugging with Verbose mode on...
|
| 7 |
+
os.system('echo "Creating virtual environment..."')
|
| 8 |
+
os.system('python -m venv /home/user/app/venv')
|
| 9 |
+
os.system('source /home/user/app/venv/bin/activate')
|
| 10 |
+
|
| 11 |
+
|
| 12 |
os.system(f'echo "Checking Python Version"')
|
| 13 |
os.system(f"python --version")
|
| 14 |
|
|
|
|
| 110 |
# Critical dependency installation sequence
|
| 111 |
os.system(f'echo "starting dependency cleanup..."')
|
| 112 |
os.system(f'pip cache purge')
|
| 113 |
+
|
| 114 |
+
# Running multiple times to remove stubborn copies
|
| 115 |
+
os.system(f'echo "Removing all existing numpy versions..."')
|
| 116 |
+
os.system(f'pip uninstall -y numpy numpy numpy')
|
| 117 |
|
| 118 |
# Force NumPy 1.26.4 first
|
| 119 |
os.system(f'echo "Installing NumPy 1.26.4..."')
|
| 120 |
os.system(f"pip install --no-cache-dir numpy==1.26.4")
|
| 121 |
|
| 122 |
+
# Verify NumPy Version 1.26.4
|
| 123 |
+
os.system(f"python -c 'import numpy; print(numpy.__version__)'")
|
| 124 |
+
|
| 125 |
# Install PyTorch + xformers with CUDA compatibility
|
| 126 |
os.system(f'echo "Installing PyTorch..."')
|
| 127 |
os.system(f"pip install torch==2.1.2+cu121 torchvision==0.16.2+cu121 --extra-index-url https://download.pytorch.org/whl/cu121 ")
|
|
|
|
| 131 |
|
| 132 |
# Final verification
|
| 133 |
os.system(f'echo "Verifying NumPy, PyTorch, and xformers versions..."')
|
| 134 |
+
|
| 135 |
os.system(f"python -c 'import torch; print(torch.__version__)'")
|
| 136 |
os.system(f"python -c 'import xformers; print(xformers.__version__)")
|
| 137 |
|