pragnakalp commited on
Commit
37d0f49
Β·
verified Β·
1 Parent(s): e74bb54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -2,13 +2,13 @@ import gradio as gr
2
  import spaces
3
  import torch
4
 
5
- # zero = torch.Tensor([0]).cuda()
6
- # print(zero.device) # <-- 'cpu' πŸ€”
7
 
8
- # @spaces.GPU
9
- # def greet(n):
10
- # print(zero.device) # <-- 'cuda:0' πŸ€—
11
- # return f"Hello {zero + n} Tensor"
12
 
13
  def one_shot(image_in,input_text,gender):
14
  print("Hello")
@@ -39,7 +39,7 @@ def run():
39
 
40
  btn.click(one_shot, inputs=[image_in,input_text,gender], outputs=[video_out])
41
  demo.queue()
42
- demo.launch()
43
 
44
  if __name__ == "__main__":
45
  run()
 
2
  import spaces
3
  import torch
4
 
5
+ zero = torch.Tensor([0]).cuda()
6
+ print(zero.device) # <-- 'cpu' πŸ€”
7
 
8
+ @spaces.GPU
9
+ def greet(n):
10
+ print(zero.device) # <-- 'cuda:0' πŸ€—
11
+ return f"Hello {zero + n} Tensor"
12
 
13
  def one_shot(image_in,input_text,gender):
14
  print("Hello")
 
39
 
40
  btn.click(one_shot, inputs=[image_in,input_text,gender], outputs=[video_out])
41
  demo.queue()
42
+ demo.launch(server_name="0.0.0.0", server_port=7860)
43
 
44
  if __name__ == "__main__":
45
  run()