Spaces:
Running
on
T4
Running
on
T4
sparkleman
commited on
Commit
·
dac6105
1
Parent(s):
271e92e
UPDATE
Browse files
app.py
CHANGED
|
@@ -34,13 +34,12 @@ CONFIG = Config()
|
|
| 34 |
import numpy as np
|
| 35 |
import torch
|
| 36 |
|
| 37 |
-
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 38 |
|
| 39 |
-
if
|
| 40 |
-
logger.info(f"
|
| 41 |
CONFIG.STRATEGY = "cpu"
|
| 42 |
|
| 43 |
-
if "cuda" in CONFIG.STRATEGY:
|
| 44 |
from pynvml import *
|
| 45 |
|
| 46 |
nvmlInit()
|
|
|
|
| 34 |
import numpy as np
|
| 35 |
import torch
|
| 36 |
|
|
|
|
| 37 |
|
| 38 |
+
if "cuda" in CONFIG.STRATEGY.lower() and not torch.cuda.is_available():
|
| 39 |
+
logger.info(f"CUDA not found, fall back to cpu")
|
| 40 |
CONFIG.STRATEGY = "cpu"
|
| 41 |
|
| 42 |
+
if "cuda" in CONFIG.STRATEGY.lower():
|
| 43 |
from pynvml import *
|
| 44 |
|
| 45 |
nvmlInit()
|