AlekseyCalvin commited on
Commit
2e8e2d2
1 Parent(s): 7a0c6a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -24,6 +24,13 @@ if not hf_token:
24
  dtype = torch.bfloat16
25
  device = "cuda:0" if torch.cuda.is_available() else "cpu"
26
 
 
 
 
 
 
 
 
27
  count0 = torch.zeros(1).to(device)
28
  count1 = torch.zeros(1).to(device)
29
  count2 = torch.zeros(1).to(device)
 
24
  dtype = torch.bfloat16
25
  device = "cuda:0" if torch.cuda.is_available() else "cpu"
26
 
27
+ if torch.cuda.is_available():
28
+ device = torch.device("cuda")
29
+ n_gpu = torch.cuda.device_count()
30
+ torch.cuda.get_device_name(0)
31
+ else:
32
+ device = torch.device("cpu")
33
+
34
  count0 = torch.zeros(1).to(device)
35
  count1 = torch.zeros(1).to(device)
36
  count2 = torch.zeros(1).to(device)