rrg92 commited on
Commit
c0ce540
·
1 Parent(s): 9b6e7fb
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -10,12 +10,12 @@ device = "cuda";
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
  RandomTensor = torch.randn(1, 2) # Example audio tensor
 
 
16
  RandomTensor.to(device)
17
 
18
- def sysinfo(device):
19
  tensorExample = RandomTensor.to(device)
20
 
21
  tocpu = tensorExample.cpu().squeeze().half().tolist()
@@ -30,12 +30,12 @@ def sysinfo(device):
30
  @spaces.GPU
31
  def gpu():
32
 
33
- return sysinfo("cuda:0");
34
 
35
 
36
  def nogpu():
37
 
38
- return sysinfo("cpu");
39
 
40
 
41
 
 
10
  if not torch.cuda.is_available() and device == "cuda":
11
  raise RuntimeError("CUDA device unavailable, please use Dockerfile.cpu instead.")
12
 
 
 
13
  RandomTensor = torch.randn(1, 2) # Example audio tensor
14
+
15
+ print("Putting Tensor in device ...", device);
16
  RandomTensor.to(device)
17
 
18
+ def sysinfo():
19
  tensorExample = RandomTensor.to(device)
20
 
21
  tocpu = tensorExample.cpu().squeeze().half().tolist()
 
30
  @spaces.GPU
31
  def gpu():
32
 
33
+ return sysinfo();
34
 
35
 
36
  def nogpu():
37
 
38
+ return sysinfo();
39
 
40
 
41