rrg92 commited on
Commit
3dbc4a6
·
1 Parent(s): f199171
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -5,9 +5,12 @@ import os;
5
  import socket;
6
  import torch
7
 
8
- device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
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