Spaces:
Running
on
L40S
Running
on
L40S
Upload app_hg.py with huggingface_hub
Browse files
app_hg.py
CHANGED
@@ -51,6 +51,7 @@ from glob import glob
|
|
51 |
|
52 |
# check_env()
|
53 |
|
|
|
54 |
def install_cuda_toolkit():
|
55 |
# CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run"
|
56 |
CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run"
|
@@ -67,15 +68,20 @@ def install_cuda_toolkit():
|
|
67 |
)
|
68 |
# Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
|
69 |
os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
|
70 |
-
try:
|
71 |
-
|
72 |
-
|
73 |
-
except Exception as err:
|
74 |
-
|
75 |
-
|
|
|
|
|
|
|
|
|
|
|
76 |
|
77 |
install_cuda_toolkit()
|
78 |
-
|
79 |
|
80 |
from infer import seed_everything, save_gif
|
81 |
from infer import Text2Image, Removebg, Image2Views, Views2Mesh, GifRenderer
|
|
|
51 |
|
52 |
# check_env()
|
53 |
|
54 |
+
@spaces.GPU
|
55 |
def install_cuda_toolkit():
|
56 |
# CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run"
|
57 |
CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run"
|
|
|
68 |
)
|
69 |
# Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
|
70 |
os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
|
71 |
+
# try:
|
72 |
+
# subprocess.check_call([sys.executable, "-m", "pip", "install", "-U", "git+https://github.com/facebookresearch/pytorch3d@stable"])
|
73 |
+
# import pytorch3d
|
74 |
+
# except Exception as err:
|
75 |
+
# print(err)
|
76 |
+
# print("new inner cuda install pytorch3d fail")
|
77 |
+
|
78 |
+
@spaces.GPU
|
79 |
+
def install_requirements():
|
80 |
+
# Install the packages listed in requirements.txt
|
81 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
|
82 |
|
83 |
install_cuda_toolkit()
|
84 |
+
install_requirements()
|
85 |
|
86 |
from infer import seed_everything, save_gif
|
87 |
from infer import Text2Image, Removebg, Image2Views, Views2Mesh, GifRenderer
|