Fix custom installation

#6
by hysts HF staff - opened
Files changed (2) hide show
  1. hg_app.py +6 -4
  2. requirements.txt +2 -1
hg_app.py CHANGED
@@ -2,6 +2,7 @@
2
  if True:
3
  import os
4
  import spaces
 
5
  import subprocess
6
  import sys
7
 
@@ -39,16 +40,17 @@ if True:
39
  )
40
  # Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
41
  os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
42
-
43
  # install_cuda_toolkit()
44
  print("cd /home/user/app/hy3dgen/texgen/differentiable_renderer/ && bash compile_mesh_painter.sh")
45
  os.system("cd /home/user/app/hy3dgen/texgen/differentiable_renderer/ && bash compile_mesh_painter.sh")
46
  # print("cd /home/user/app/hy3dgen/texgen/custom_rasterizer && python3 -m pip install .")
47
  # os.system("cd /home/user/app/hy3dgen/texgen/custom_rasterizer && python3 -m pip install .")
48
  print('install custom')
49
- install_package("/home/user/app/hy3dgen/texgen/custom_rasterizer")
50
  # 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")
51
-
 
52
  IP = "0.0.0.0"
53
  PORT = 7860
54
 
@@ -333,7 +335,7 @@ def build_app():
333
  label="Text Prompts", examples_per_page=18)
334
 
335
  if not HAS_TEXTUREGEN:
336
- gr.HTML(""")
337
  <div style="margin-top: 20px;">
338
  <b>Warning: </b>
339
  Texture synthesis is disable due to missing requirements,
 
2
  if True:
3
  import os
4
  import spaces
5
+ import shlex
6
  import subprocess
7
  import sys
8
 
 
40
  )
41
  # Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
42
  os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
43
+
44
  # install_cuda_toolkit()
45
  print("cd /home/user/app/hy3dgen/texgen/differentiable_renderer/ && bash compile_mesh_painter.sh")
46
  os.system("cd /home/user/app/hy3dgen/texgen/differentiable_renderer/ && bash compile_mesh_painter.sh")
47
  # print("cd /home/user/app/hy3dgen/texgen/custom_rasterizer && python3 -m pip install .")
48
  # os.system("cd /home/user/app/hy3dgen/texgen/custom_rasterizer && python3 -m pip install .")
49
  print('install custom')
50
+ # install_package("/home/user/app/hy3dgen/texgen/custom_rasterizer")
51
  # 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")
52
+ subprocess.run(shlex.split("pip install . --no-build-isolation"), cwd="/home/user/app/hy3dgen/texgen/custom_rasterizer/", check=True)
53
+
54
  IP = "0.0.0.0"
55
  PORT = 7860
56
 
 
335
  label="Text Prompts", examples_per_page=18)
336
 
337
  if not HAS_TEXTUREGEN:
338
+ gr.HTML("""
339
  <div style="margin-top: 20px;">
340
  <b>Warning: </b>
341
  Texture synthesis is disable due to missing requirements,
requirements.txt CHANGED
@@ -32,4 +32,5 @@ pygltflib
32
  sentencepiece
33
  gradio
34
  uvicorn
35
- fastapi
 
 
32
  sentencepiece
33
  gradio
34
  uvicorn
35
+ fastapi
36
+ wheel