LTT commited on
Commit
2de9183
·
verified ·
1 Parent(s): 136aa3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -28,24 +28,24 @@ import sys
28
  import tempfile
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
 
50
 
51
  print(f"GPU: {torch.cuda.is_available()}")
 
28
  import tempfile
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
 
50
 
51
  print(f"GPU: {torch.cuda.is_available()}")