darkstorm2150 commited on
Commit
05ad30b
·
verified ·
1 Parent(s): 2277016

Enforce NumPy 1.26.4 at Runtime

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -107,11 +107,19 @@ else:
107
  os.system(f'echo "Installing xformers for attention optimization..."')
108
  os.system(f"pip install xformers==0.0.25")
109
 
110
- # diagnostic checks to confirm versions
 
 
 
 
 
 
 
 
111
  os.system(f'echo "Verifying NumPy, PyTorch, and xformers versions..."')
112
  os.system(f"python -c 'import numpy; print(numpy.__version__)'")
113
  os.system(f"python -c 'import torch; print(torch.__version__)'")
114
- os.system(f"python -c 'import xformers; print(xformers.__version__)'")
115
 
116
  # Launch WebUI with custom settings
117
  os.system(f'echo "Starting WebUI with custom configurations..."')
 
107
  os.system(f'echo "Installing xformers for attention optimization..."')
108
  os.system(f"pip install xformers==0.0.25")
109
 
110
+ # Remove NumPy 2.x (if pulled in by other packages)
111
+ os.system(f'echo "Removing NumPy 2.x (if present)..."')
112
+ os.system(f"pip uninstall -y numpy && pip install --no-cache-dir numpy==1.26.4")
113
+
114
+ # Reinstall xformers to ensure compatibility
115
+ os.system(f'echo "Reinstalling xformers to ensure NumPy 1.26.4 compatibility..."')
116
+ os.system(f"pip uninstall -y xformers && pip install --no-cache-dir xformers==0.0.25")
117
+
118
+ # Diagnostic checks
119
  os.system(f'echo "Verifying NumPy, PyTorch, and xformers versions..."')
120
  os.system(f"python -c 'import numpy; print(numpy.__version__)'")
121
  os.system(f"python -c 'import torch; print(torch.__version__)'")
122
+ os.system(f"python -c 'import xformers; print(xformers.__version__)")
123
 
124
  # Launch WebUI with custom settings
125
  os.system(f'echo "Starting WebUI with custom configurations..."')