Update app.py
Browse files
app.py
CHANGED
@@ -29,20 +29,21 @@ import tempfile
|
|
29 |
from huggingface_hub import hf_hub_download
|
30 |
|
31 |
def install_cuda_toolkit():
|
32 |
-
""
|
33 |
-
|
34 |
-
""
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
46 |
|
47 |
install_cuda_toolkit()
|
48 |
|
|
|
29 |
from huggingface_hub import hf_hub_download
|
30 |
|
31 |
def install_cuda_toolkit():
|
32 |
+
CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run"
|
33 |
+
# CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run"
|
34 |
+
CUDA_TOOLKIT_FILE = "/tmp/%s" % os.path.basename(CUDA_TOOLKIT_URL)
|
35 |
+
subprocess.call(["wget", "-q", CUDA_TOOLKIT_URL, "-O", CUDA_TOOLKIT_FILE])
|
36 |
+
subprocess.call(["chmod", "+x", CUDA_TOOLKIT_FILE])
|
37 |
+
subprocess.call([CUDA_TOOLKIT_FILE, "--silent", "--toolkit"])
|
38 |
+
|
39 |
+
os.environ["CUDA_HOME"] = "/usr/local/cuda"
|
40 |
+
os.environ["PATH"] = "%s/bin:%s" % (os.environ["CUDA_HOME"], os.environ["PATH"])
|
41 |
+
os.environ["LD_LIBRARY_PATH"] = "%s/lib:%s" % (
|
42 |
+
os.environ["CUDA_HOME"],
|
43 |
+
"" if "LD_LIBRARY_PATH" not in os.environ else os.environ["LD_LIBRARY_PATH"],
|
44 |
+
)
|
45 |
+
# Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
|
46 |
+
os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
|
47 |
|
48 |
install_cuda_toolkit()
|
49 |
|