ysharma's picture
ysharma HF Staff
Update app.py
7aaa4cb verified
raw
history blame
884 Bytes
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,
type="messages",
examples=[
{"text": "Hello",
"files": ["https://i.natgeofe.com/n/5f35194b-af37-4f45-a14d-60925b280986/NationalGeographic_2731043_square.jpg"]},
{"text": "another one with webp",
"files":["https://marketing.legal/files/AMBX545453KPG5T/images/wm-robot/waiter.webp"]},
],
title="Echo Bot",
multimodal=True,
cache_examples=True)
demo.launch(debug=True, share=True)