import gradio as gr import time def count_files(message, history): num_files = len(message["files"]) return f"You uploaded {num_files} files" demo = gr.ChatInterface(fn=count_files, examples=[ {"text": "Hello", "files": ['https://www.gradio.app/_app/immutable/assets/header-image.DJQS6l6U.jpg']}, {"text": "Hello", "files": ['https://www.gradio.app/_app/immutable/assets/gradio-logo-with-title.3SNGTZpF.svg']}, {"text": "Hello", "files": ['https://user-images.githubusercontent.com/1778297/158659207-04015a06-5cad-4ee1-bdbd-291054551540.png']}, {"text": "Hello", "files": ['https://chunte-hfba.static.hf.space/images/Brand%20Logos/Rainbow%20Hugging%20Face.png']}, {"text": "Hello", "files": ['https://www.gstatic.com/webp/gallery/1.sm.webp']}, ], title="Echo Bot", multimodal=True) demo.launch()