Spaces:
Sleeping
Sleeping
JasonJwba
commited on
Commit
•
d413c28
1
Parent(s):
11711c0
Update app.py
Browse files
app.py
CHANGED
@@ -1,26 +1,26 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
|
9 |
-
|
10 |
-
|
11 |
|
12 |
-
import spaces
|
13 |
-
from diffusers import DiffusionPipeline
|
14 |
|
15 |
-
pipe = DiffusionPipeline.from_pretrained(...)
|
16 |
-
pipe.to('cuda')
|
17 |
|
18 |
-
@spaces.GPU
|
19 |
-
def generate(prompt):
|
20 |
-
|
21 |
|
22 |
-
gr.Interface(
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
).launch()
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import spaces
|
3 |
+
import torch
|
4 |
|
5 |
+
@spaces.GPU
|
6 |
+
def greet(name):
|
7 |
+
return f"Tensor: {torch.Tensor([0]).cuda()}, Name: {name}"
|
8 |
|
9 |
+
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
10 |
+
iface.launch()
|
11 |
|
12 |
+
# import spaces
|
13 |
+
# from diffusers import DiffusionPipeline
|
14 |
|
15 |
+
# pipe = DiffusionPipeline.from_pretrained(...)
|
16 |
+
# pipe.to('cuda')
|
17 |
|
18 |
+
# @spaces.GPU
|
19 |
+
# def generate(prompt):
|
20 |
+
# return pipe(prompt).images
|
21 |
|
22 |
+
# gr.Interface(
|
23 |
+
# fn=generate,
|
24 |
+
# inputs=gr.Text(),
|
25 |
+
# outputs=gr.Gallery(),
|
26 |
+
# ).launch()
|