#!/usr/bin/env python import gradio as gr def run(message, history): return message["text"] examples = [ {"text": "hey", "files": ["cats.jpg"]}, {"text": "hello", "files": ["dogs.jpg"]}, ] chatbot = gr.ChatInterface(fn=run, multimodal=True, examples=examples, cache_examples=False) with gr.Blocks(fill_height=True) as demo: chatbot.render() chatbot.examples_handler.load_input_event.then( fn=lambda: [[], [], None], outputs=[chatbot.chatbot, chatbot.chatbot_state, chatbot.saved_input], ) if __name__ == "__main__": demo.queue().launch()