Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,38 +6,29 @@ def combine(a, b):
|
|
6 |
return a + " " + b
|
7 |
|
8 |
|
9 |
-
def mirror(x):
|
10 |
-
return x
|
11 |
|
12 |
|
13 |
with gr.Blocks() as demo:
|
14 |
|
15 |
txt = gr.Textbox(label="Input", lines=2)
|
16 |
-
|
17 |
-
txt_3 = gr.Textbox(value="", label="Output")
|
18 |
-
btn = gr.Button(value="Submit")
|
19 |
-
btn.click(combine, inputs=[txt, txt_2], outputs=[txt_3])
|
20 |
|
21 |
with gr.Row():
|
22 |
im = gr.Image()
|
23 |
im_2 = gr.Image()
|
24 |
|
25 |
-
btn = gr.Button(value="Mirror
|
26 |
-
btn.click(mirror, inputs=[im], outputs=[im_2])
|
27 |
|
28 |
-
gr.Markdown("## Text Examples")
|
29 |
-
gr.Examples(
|
30 |
-
[["hi", "Adam"], ["hello", "Eve"]],
|
31 |
-
[txt, txt_2],
|
32 |
-
txt_3,
|
33 |
-
combine,
|
34 |
-
cache_examples=True,
|
35 |
-
)
|
36 |
gr.Markdown("## Image Examples")
|
37 |
gr.Examples(
|
38 |
-
examples=["./examples/f.png",
|
39 |
-
|
40 |
-
|
|
|
|
|
41 |
fn=mirror,
|
42 |
cache_examples=True,
|
43 |
)
|
|
|
6 |
return a + " " + b
|
7 |
|
8 |
|
9 |
+
def mirror(x,y):
|
10 |
+
return x,y
|
11 |
|
12 |
|
13 |
with gr.Blocks() as demo:
|
14 |
|
15 |
txt = gr.Textbox(label="Input", lines=2)
|
16 |
+
txt1 = gr.Textbox(label="Input", lines=2)
|
|
|
|
|
|
|
17 |
|
18 |
with gr.Row():
|
19 |
im = gr.Image()
|
20 |
im_2 = gr.Image()
|
21 |
|
22 |
+
btn = gr.Button(value="Mirror Everything")
|
23 |
+
btn.click(mirror, inputs=[im, txt], outputs=[im_2, txt1])
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
gr.Markdown("## Image Examples")
|
26 |
gr.Examples(
|
27 |
+
examples=[["./examples/f.png","example1"],
|
28 |
+
["./examples/f1.png","example2"],
|
29 |
+
["./examples/f2.png","example3"]],
|
30 |
+
inputs=[im,txt],
|
31 |
+
outputs=[im_2,txt1],
|
32 |
fn=mirror,
|
33 |
cache_examples=True,
|
34 |
)
|