alexnasa commited on
Commit
8de7808
·
verified ·
1 Parent(s): 58acdcb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -34
app.py CHANGED
@@ -17,40 +17,11 @@ from PIL import Image
17
  from accelerate.utils import set_seed
18
 
19
  import subprocess
20
- import importlib, site, sys
21
-
22
- # Re-discover all .pth/.egg-link files
23
- for sitedir in site.getsitepackages():
24
- site.addsitedir(sitedir)
25
-
26
- # Clear caches so importlib will pick up new modules
27
- importlib.invalidate_caches()
28
-
29
- def sh(cmd): subprocess.check_call(cmd, shell=True)
30
-
31
- def install_cuda_toolkit():
32
- CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/12.6.0/local_installers/cuda_12.6.0_560.28.03_linux.run"
33
- CUDA_TOOLKIT_FILE = "/tmp/%s" % os.path.basename(CUDA_TOOLKIT_URL)
34
- subprocess.call(["wget", "-q", CUDA_TOOLKIT_URL, "-O", CUDA_TOOLKIT_FILE])
35
- subprocess.call(["chmod", "+x", CUDA_TOOLKIT_FILE])
36
- subprocess.call([CUDA_TOOLKIT_FILE, "--silent", "--toolkit"])
37
-
38
- os.environ["CUDA_HOME"] = "/usr/local/cuda"
39
- os.environ["PATH"] = "%s/bin:%s" % (os.environ["CUDA_HOME"], os.environ["PATH"])
40
- os.environ["LD_LIBRARY_PATH"] = "%s/lib:%s" % (
41
- os.environ["CUDA_HOME"],
42
- "" if "LD_LIBRARY_PATH" not in os.environ else os.environ["LD_LIBRARY_PATH"],
43
- )
44
- # Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
45
- os.environ["TORCH_CUDA_ARCH_LIST"] = "9.0"
46
- print("==> finished installation")
47
-
48
- install_cuda_toolkit()
49
-
50
- sh("pip install diso")
51
-
52
- # tell Python to re-scan site-packages now that the egg-link exists
53
- import importlib, site; site.addsitedir(site.getsitepackages()[0]); importlib.invalidate_caches()
54
 
55
 
56
  from src.utils.data_utils import get_colored_mesh_composition, scene_to_parts, load_surfaces
 
17
  from accelerate.utils import set_seed
18
 
19
  import subprocess
20
+
21
+ subprocess.run([
22
+ "pip", "install", "--no-build-isolation",
23
+ "diso@git+https://github.com/SarahWeiii/diso.git"
24
+ ], check=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
 
27
  from src.utils.data_utils import get_colored_mesh_composition, scene_to_parts, load_surfaces