Spaces:
Running
Running
Commit
·
77d2cc4
1
Parent(s):
7bb9bae
fix
Browse files
app.py
CHANGED
|
@@ -2,7 +2,15 @@ import os
|
|
| 2 |
import subprocess
|
| 3 |
import importlib.util
|
| 4 |
|
| 5 |
-
NVIDIA_AVAILABLE =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
if NVIDIA_AVAILABLE:
|
| 8 |
DEVICES = ["cpu", "cuda"]
|
|
|
|
| 2 |
import subprocess
|
| 3 |
import importlib.util
|
| 4 |
|
| 5 |
+
NVIDIA_AVAILABLE = (
|
| 6 |
+
subprocess.run(
|
| 7 |
+
"nvidia-smi",
|
| 8 |
+
shell=True,
|
| 9 |
+
stdout=subprocess.DEVNULL,
|
| 10 |
+
stderr=subprocess.DEVNULL,
|
| 11 |
+
).returncode
|
| 12 |
+
== 0
|
| 13 |
+
)
|
| 14 |
|
| 15 |
if NVIDIA_AVAILABLE:
|
| 16 |
DEVICES = ["cpu", "cuda"]
|