Spaces:
Paused
Paused
Upload 12 files
Browse files- install-onnx.py +23 -14
install-onnx.py
CHANGED
|
@@ -37,41 +37,50 @@ def main():
|
|
| 37 |
"""Try multiple ONNX Runtime installation approaches"""
|
| 38 |
print("π Starting aggressive ONNX Runtime installation...")
|
| 39 |
|
| 40 |
-
# Method 1: Try
|
| 41 |
-
print("\nπ Method 1:
|
| 42 |
-
if run_command("pip install onnxruntime
|
| 43 |
if test_onnx_import():
|
| 44 |
print("π Method 1 SUCCESS!")
|
| 45 |
return True
|
| 46 |
else:
|
| 47 |
-
run_command("pip uninstall -y onnxruntime
|
| 48 |
|
| 49 |
-
# Method 2: Try
|
| 50 |
-
print("\nπ Method 2:
|
| 51 |
-
if run_command("pip install onnxruntime==1.
|
| 52 |
if test_onnx_import():
|
| 53 |
print("π Method 2 SUCCESS!")
|
| 54 |
return True
|
| 55 |
else:
|
| 56 |
run_command("pip uninstall -y onnxruntime", ignore_errors=True)
|
| 57 |
|
| 58 |
-
# Method 3: Try
|
| 59 |
-
print("\nπ Method 3:
|
| 60 |
-
if run_command("pip install onnxruntime==1.
|
| 61 |
if test_onnx_import():
|
| 62 |
print("π Method 3 SUCCESS!")
|
| 63 |
return True
|
| 64 |
else:
|
| 65 |
run_command("pip uninstall -y onnxruntime", ignore_errors=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
-
# Method
|
| 68 |
-
print("\nπ Method
|
| 69 |
if run_command("pip install torch==2.0.1 --extra-index-url https://download.pytorch.org/whl/cpu"):
|
| 70 |
print("β
PyTorch installed as ONNX Runtime alternative")
|
| 71 |
return True
|
| 72 |
|
| 73 |
-
# Method
|
| 74 |
-
print("\nπ Method
|
| 75 |
if run_command("pip install tensorflow==2.13.0"):
|
| 76 |
print("β
TensorFlow installed as ONNX Runtime alternative")
|
| 77 |
return True
|
|
|
|
| 37 |
"""Try multiple ONNX Runtime installation approaches"""
|
| 38 |
print("π Starting aggressive ONNX Runtime installation...")
|
| 39 |
|
| 40 |
+
# Method 1: Try latest available onnxruntime
|
| 41 |
+
print("\nπ Method 1: Latest available onnxruntime")
|
| 42 |
+
if run_command("pip install onnxruntime==1.22.1"):
|
| 43 |
if test_onnx_import():
|
| 44 |
print("π Method 1 SUCCESS!")
|
| 45 |
return True
|
| 46 |
else:
|
| 47 |
+
run_command("pip uninstall -y onnxruntime", ignore_errors=True)
|
| 48 |
|
| 49 |
+
# Method 2: Try stable version
|
| 50 |
+
print("\nπ Method 2: Stable onnxruntime")
|
| 51 |
+
if run_command("pip install onnxruntime==1.20.1"):
|
| 52 |
if test_onnx_import():
|
| 53 |
print("π Method 2 SUCCESS!")
|
| 54 |
return True
|
| 55 |
else:
|
| 56 |
run_command("pip uninstall -y onnxruntime", ignore_errors=True)
|
| 57 |
|
| 58 |
+
# Method 3: Try minimum available version
|
| 59 |
+
print("\nπ Method 3: Minimum available onnxruntime")
|
| 60 |
+
if run_command("pip install onnxruntime==1.15.1"):
|
| 61 |
if test_onnx_import():
|
| 62 |
print("π Method 3 SUCCESS!")
|
| 63 |
return True
|
| 64 |
else:
|
| 65 |
run_command("pip uninstall -y onnxruntime", ignore_errors=True)
|
| 66 |
+
|
| 67 |
+
# Method 4: Try alternative OpenVino build
|
| 68 |
+
print("\nπ Method 4: OpenVino alternative build")
|
| 69 |
+
if run_command("pip install onnxruntime-openvino==1.22.0"):
|
| 70 |
+
if test_onnx_import():
|
| 71 |
+
print("π Method 4 SUCCESS!")
|
| 72 |
+
return True
|
| 73 |
+
else:
|
| 74 |
+
run_command("pip uninstall -y onnxruntime-openvino", ignore_errors=True)
|
| 75 |
|
| 76 |
+
# Method 5: Try CPU-only PyTorch instead
|
| 77 |
+
print("\nπ Method 5: PyTorch CPU-only alternative")
|
| 78 |
if run_command("pip install torch==2.0.1 --extra-index-url https://download.pytorch.org/whl/cpu"):
|
| 79 |
print("β
PyTorch installed as ONNX Runtime alternative")
|
| 80 |
return True
|
| 81 |
|
| 82 |
+
# Method 6: Try TensorFlow Lite
|
| 83 |
+
print("\nπ Method 6: TensorFlow Lite alternative")
|
| 84 |
if run_command("pip install tensorflow==2.13.0"):
|
| 85 |
print("β
TensorFlow installed as ONNX Runtime alternative")
|
| 86 |
return True
|