Spaces:
Running
Running
pragnakalp
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -2,13 +2,13 @@ import gradio as gr
|
|
2 |
import spaces
|
3 |
import torch
|
4 |
|
5 |
-
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
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()
|