kayte0342 commited on
Commit
c72e568
·
verified ·
1 Parent(s): 47ef246

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -1,7 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import os
2
  import subprocess
3
  import urllib.request
4
  import torch
 
 
5
  print("Torch version:", torch.__version__)
6
  if torch.cuda.is_available():
7
  cap = torch.cuda.get_device_capability(0)
 
1
+ import gradio as gr
2
+ import spaces
3
+ import torch
4
+
5
+
6
+ #@spaces.GPU
7
+ #def greet(n):
8
+ # print(zero.device) # <-- 'cuda:0' 🤗
9
+ # return f"Hello {zero + n} Tensor"
10
+
11
+ #demo = gr.Interface(fn=greet, inputs=gr.Number(), outputs=gr.Text())
12
+ #demo.launch()
13
+
14
  import os
15
  import subprocess
16
  import urllib.request
17
  import torch
18
+ zero = torch.Tensor([0]).cuda()
19
+ print(zero.device) # <-- 'cpu' 🤔
20
  print("Torch version:", torch.__version__)
21
  if torch.cuda.is_available():
22
  cap = torch.cuda.get_device_capability(0)