[martin-dev] fix example 4; no cache for now
Browse files- demo/launch_gradio.py +16 -9
demo/launch_gradio.py
CHANGED
|
@@ -593,15 +593,6 @@ def create_demo() -> gr.Blocks:
|
|
| 593 |
lines=3
|
| 594 |
)
|
| 595 |
|
| 596 |
-
# GPU-safe interactive examples
|
| 597 |
-
gr.Markdown("### Example Prompts (Click to Insert)")
|
| 598 |
-
gr.Button("Example 1").click(fn=example1,
|
| 599 |
-
outputs=[instruction_input, image1_input, image2_input])
|
| 600 |
-
gr.Button("Example 2").click(fn=example2,
|
| 601 |
-
outputs=[instruction_input, image1_input, image2_input])
|
| 602 |
-
gr.Button("Example 3").click(fn=example3,
|
| 603 |
-
outputs=[instruction_input, image1_input, image2_input])
|
| 604 |
-
|
| 605 |
top_k_slider = gr.Slider(
|
| 606 |
minimum=1,
|
| 607 |
maximum=20,
|
|
@@ -644,6 +635,22 @@ def create_demo() -> gr.Blocks:
|
|
| 644 |
outputs=[plot_output, info_output]
|
| 645 |
)
|
| 646 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 647 |
return demo
|
| 648 |
|
| 649 |
|
|
|
|
| 593 |
lines=3
|
| 594 |
)
|
| 595 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 596 |
top_k_slider = gr.Slider(
|
| 597 |
minimum=1,
|
| 598 |
maximum=20,
|
|
|
|
| 635 |
outputs=[plot_output, info_output]
|
| 636 |
)
|
| 637 |
|
| 638 |
+
# Custom interactive examples (safe for GPU Spaces)
|
| 639 |
+
gr.Markdown("### Example Prompts (Click to Insert)")
|
| 640 |
+
with gr.Row():
|
| 641 |
+
gr.Button("Example 1").click(
|
| 642 |
+
fn=lambda: ("What is in this image? Describe in one word.", None, None),
|
| 643 |
+
outputs=[instruction_input, image1_input, image2_input]
|
| 644 |
+
)
|
| 645 |
+
gr.Button("Example 2").click(
|
| 646 |
+
fn=lambda: ("Describe the main object in the picture in one word.", None, None),
|
| 647 |
+
outputs=[instruction_input, image1_input, image2_input]
|
| 648 |
+
)
|
| 649 |
+
gr.Button("Example 3").click(
|
| 650 |
+
fn=lambda: ("What color is the dominant object? Describe in one word.", None, None),
|
| 651 |
+
outputs=[instruction_input, image1_input, image2_input]
|
| 652 |
+
)
|
| 653 |
+
|
| 654 |
return demo
|
| 655 |
|
| 656 |
|