import gradio as gr import time def count_files(message, history): print(f"messgae -- {message}") print(f"history -- {history}") num_files = len(message["files"]) return f"You uploaded {num_files} files" demo = gr.ChatInterface(fn=count_files, fill_height=True, type="messages", #examples=[{"text": "Hello", "files": ["https://i.natgeofe.com/n/5f35194b-af37-4f45-a14d-60925b280986/NationalGeographic_2731043_square.jpg"]}], title="Echo Bot", #multimodal=True, cache_examples=True ) demo.launch()