Spaces:
Running
on
Zero
Running
on
Zero
Upload gradio_app.py with huggingface_hub
Browse files- gradio_app.py +5 -4
gradio_app.py
CHANGED
@@ -18,9 +18,10 @@ def install_cuda_toolkit():
|
|
18 |
# Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
|
19 |
os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
|
20 |
|
21 |
-
install_cuda_toolkit()
|
22 |
os.system("cd /home/user/app/hy3dgen/texgen/differentiable_renderer/ && bash compile_mesh_painter.sh")
|
23 |
os.system("cd /home/user/app/hy3dgen/texgen/custom_rasterizer && pip install .")
|
|
|
24 |
|
25 |
import shutil
|
26 |
import time
|
@@ -100,7 +101,7 @@ def build_model_viewer_html(save_folder, height=660, width=790, textured=False):
|
|
100 |
</div>
|
101 |
"""
|
102 |
|
103 |
-
@spaces.GPU()
|
104 |
def _gen_shape(
|
105 |
caption,
|
106 |
image,
|
@@ -157,7 +158,7 @@ def _gen_shape(
|
|
157 |
stats['time'] = time_meta
|
158 |
return mesh, save_folder
|
159 |
|
160 |
-
@spaces.GPU()
|
161 |
def generation_all(
|
162 |
caption,
|
163 |
image,
|
@@ -190,7 +191,7 @@ def generation_all(
|
|
190 |
model_viewer_html_textured,
|
191 |
)
|
192 |
|
193 |
-
@spaces.GPU()
|
194 |
def shape_generation(
|
195 |
caption,
|
196 |
image,
|
|
|
18 |
# Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
|
19 |
os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
|
20 |
|
21 |
+
# install_cuda_toolkit()
|
22 |
os.system("cd /home/user/app/hy3dgen/texgen/differentiable_renderer/ && bash compile_mesh_painter.sh")
|
23 |
os.system("cd /home/user/app/hy3dgen/texgen/custom_rasterizer && pip install .")
|
24 |
+
os.system("cd /home/user/app/hy3dgen/texgen/custom_rasterizer && CUDA_HOME=/usr/local/cuda FORCE_CUDA=1 TORCH_CUDA_ARCH_LIST='8.0;8.6;8.9;9.0' python setup.py install")
|
25 |
|
26 |
import shutil
|
27 |
import time
|
|
|
101 |
</div>
|
102 |
"""
|
103 |
|
104 |
+
@spaces.GPU(duration=60)
|
105 |
def _gen_shape(
|
106 |
caption,
|
107 |
image,
|
|
|
158 |
stats['time'] = time_meta
|
159 |
return mesh, save_folder
|
160 |
|
161 |
+
@spaces.GPU(duration=80)
|
162 |
def generation_all(
|
163 |
caption,
|
164 |
image,
|
|
|
191 |
model_viewer_html_textured,
|
192 |
)
|
193 |
|
194 |
+
@spaces.GPU(duration=30)
|
195 |
def shape_generation(
|
196 |
caption,
|
197 |
image,
|