Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,20 +35,20 @@ def greet3(x, progress=gr.Progress()):
|
|
| 35 |
return "hello"
|
| 36 |
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
#demo = gr.Interface(
|
| 45 |
-
# fn=greet3,
|
| 46 |
-
# inputs=gr.Textbox(),
|
| 47 |
-
# outputs=gr.Textbox(),
|
| 48 |
-
# examples = "./example",
|
| 49 |
-
# inputs=gr.Video(),
|
| 50 |
-
# outputs="text",
|
| 51 |
-
# examples = "./example",
|
| 52 |
-
#)
|
| 53 |
demo.queue().launch(debug=True)
|
| 54 |
|
|
|
|
| 35 |
return "hello"
|
| 36 |
|
| 37 |
|
| 38 |
+
with gr.Blocks() as demo:
|
| 39 |
+
with gr.Row():
|
| 40 |
+
input = gr.Image()
|
| 41 |
+
output = gr.Textbox(value="", label="Output")
|
| 42 |
+
btn = gr.Button(value="Submit")
|
| 43 |
+
btn.click(greet3, inputs=input, outputs=output)
|
| 44 |
+
|
| 45 |
+
gr.Examples(
|
| 46 |
+
examples=[os.path.join(os.path.dirname(__file__), "example/test.mp4")],
|
| 47 |
+
inputs=input,
|
| 48 |
+
outputs=output,
|
| 49 |
+
fn=greet3,
|
| 50 |
+
cache_examples=True,
|
| 51 |
+
)
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
demo.queue().launch(debug=True)
|
| 54 |
|