import gradio as gr def generate_predictions(image_input, text_input): return image_input with gr.Blocks(title="Kosmos-2", theme=gr.themes.Base()).queue() as demo: with gr.Row(): with gr.Column(): image_input = gr.Image(type="pil", label="Test Image") run_button = gr.Button(label="Run", visible=True) with gr.Column(): image_output = gr.Image(type="pil") with gr.Row(): with gr.Column(): gr.Examples(examples=[ ["cheetah.jpg"], ], inputs=[image_input] ) run_button.click(fn=generate_predictions, inputs=[image_input], outputs=[image_output], ) demo.launch()