Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,26 @@ from gradio_litmodel3d import LitModel3D
|
|
4 |
|
5 |
import os
|
6 |
import shutil
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
os.environ['SPCONV_ALGO'] = 'native'
|
8 |
from typing import *
|
9 |
import torch
|
|
|
4 |
|
5 |
import os
|
6 |
import shutil
|
7 |
+
import subprocess
|
8 |
+
import sys
|
9 |
+
|
10 |
+
# Install local wheels at runtime
|
11 |
+
def install_local_wheels():
|
12 |
+
"""Install the local wheel files that couldn't be installed during Docker build."""
|
13 |
+
wheels_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'wheels')
|
14 |
+
if os.path.exists(wheels_dir):
|
15 |
+
wheel_files = [f for f in os.listdir(wheels_dir) if f.endswith('.whl')]
|
16 |
+
for wheel_file in wheel_files:
|
17 |
+
wheel_path = os.path.join(wheels_dir, wheel_file)
|
18 |
+
try:
|
19 |
+
subprocess.check_call([sys.executable, '-m', 'pip', 'install', wheel_path])
|
20 |
+
print(f"Successfully installed {wheel_file}")
|
21 |
+
except subprocess.CalledProcessError as e:
|
22 |
+
print(f"Failed to install {wheel_file}: {e}")
|
23 |
+
|
24 |
+
# Install wheels before importing trellis
|
25 |
+
install_local_wheels()
|
26 |
+
|
27 |
os.environ['SPCONV_ALGO'] = 'native'
|
28 |
from typing import *
|
29 |
import torch
|