demo 1
Browse files
app.py
CHANGED
|
@@ -5,9 +5,12 @@ import os;
|
|
| 5 |
import socket;
|
| 6 |
import torch
|
| 7 |
|
| 8 |
-
device =
|
| 9 |
|
|
|
|
|
|
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
def sysinfo(device):
|
| 13 |
RandomTensor = torch.randn(1, 2) # Example audio tensor
|
|
|
|
| 5 |
import socket;
|
| 6 |
import torch
|
| 7 |
|
| 8 |
+
device = "cuda";
|
| 9 |
|
| 10 |
+
if not torch.cuda.is_available() and device == "cuda":
|
| 11 |
+
raise RuntimeError("CUDA device unavailable, please use Dockerfile.cpu instead.")
|
| 12 |
|
| 13 |
+
print("DEVICE: ", device);
|
| 14 |
|
| 15 |
def sysinfo(device):
|
| 16 |
RandomTensor = torch.randn(1, 2) # Example audio tensor
|