[martin-dev] fix example 2; no cache for now
Browse files- demo/launch_gradio.py +16 -11
demo/launch_gradio.py
CHANGED
|
@@ -625,17 +625,22 @@ def create_demo() -> gr.Blocks:
|
|
| 625 |
outputs=[plot_output, info_output]
|
| 626 |
)
|
| 627 |
|
| 628 |
-
#
|
| 629 |
-
gr.
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 639 |
|
| 640 |
return demo
|
| 641 |
|
|
|
|
| 625 |
outputs=[plot_output, info_output]
|
| 626 |
)
|
| 627 |
|
| 628 |
+
# Custom interactive examples (safe for GPU Spaces)
|
| 629 |
+
gr.Markdown("### Example Prompts (Click to Insert)")
|
| 630 |
+
|
| 631 |
+
with gr.Row():
|
| 632 |
+
gr.Button("Example 1").click(
|
| 633 |
+
fn=lambda: ("What is in this image? Describe in one word.", None, None),
|
| 634 |
+
outputs=[instruction_input, image1_input, image2_input]
|
| 635 |
+
)
|
| 636 |
+
gr.Button("Example 2").click(
|
| 637 |
+
fn=lambda: ("Describe the main object in the picture in one word.", None, None),
|
| 638 |
+
outputs=[instruction_input, image1_input, image2_input]
|
| 639 |
+
)
|
| 640 |
+
gr.Button("Example 3").click(
|
| 641 |
+
fn=lambda: ("What color is the dominant object? Describe in one word.", None, None),
|
| 642 |
+
outputs=[instruction_input, image1_input, image2_input]
|
| 643 |
+
)
|
| 644 |
|
| 645 |
return demo
|
| 646 |
|