Spaces:
Running
Running
Delete app.py with huggingface_hub
Browse files
app.py
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
import os
|
3 |
-
|
4 |
-
def combine(a, b):
|
5 |
-
return a + " " + b
|
6 |
-
|
7 |
-
def mirror(x):
|
8 |
-
return x
|
9 |
-
|
10 |
-
with gr.Blocks() as demo:
|
11 |
-
|
12 |
-
txt = gr.Textbox(label="Input", lines=2)
|
13 |
-
txt_2 = gr.Textbox(label="Input 2")
|
14 |
-
txt_3 = gr.Textbox(value="", label="Output")
|
15 |
-
btn = gr.Button(value="Submit")
|
16 |
-
btn.click(combine, inputs=[txt, txt_2], outputs=[txt_3])
|
17 |
-
|
18 |
-
with gr.Row():
|
19 |
-
im = gr.Image()
|
20 |
-
im_2 = gr.Image()
|
21 |
-
|
22 |
-
btn = gr.Button(value="Mirror Image")
|
23 |
-
btn.click(mirror, inputs=[im], outputs=[im_2])
|
24 |
-
|
25 |
-
gr.Markdown("## Text Examples")
|
26 |
-
gr.Examples([["hi", "Adam"], ["hello", "Eve"]], [txt, txt_2], txt_3, combine, cache_examples=True)
|
27 |
-
gr.Markdown("## Image Examples")
|
28 |
-
gr.Examples(
|
29 |
-
examples=[os.path.join(os.path.dirname(__file__), "lion.jpg")],
|
30 |
-
inputs=im,
|
31 |
-
outputs=im_2,
|
32 |
-
fn=mirror,
|
33 |
-
cache_examples=True)
|
34 |
-
|
35 |
-
if __name__ == "__main__":
|
36 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|