Spaces:
Sleeping
Sleeping
JasonJwba
commited on
Commit
•
16c4918
1
Parent(s):
d2625c6
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,13 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
|
|
|
|
|
|
|
3 |
def greet(name):
|
4 |
-
return "
|
5 |
-
|
6 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
iface.launch()
|
8 |
|
|
|
1 |
import gradio as gr
|
2 |
+
import spaces
|
3 |
+
import torch
|
4 |
|
5 |
+
# def greet(name):
|
6 |
+
# return "Hello " + name + "!!"
|
7 |
+
@spaces.GPU
|
8 |
def greet(name):
|
9 |
+
return f"Tensor: {torch.Tensor([0]).cuda()}, Name: {name}"
|
10 |
+
|
11 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
12 |
iface.launch()
|
13 |
|