File size: 491 Bytes
06ef074 c08ac3d 06ef074 ec3e1e7 06ef074 b62fac9 06ef074 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import gradio as gr
image = gr.get_image("avatar.png")
audio = gr.get_audio("cantina.wav")
def echo(message, history):
return f"You wrote: {message['text']} and uploaded {len(message['files'])} files."
demo = gr.ChatInterface(
fn=echo,
examples=[{"text": "hello"}, {"text": "hola", "files": [image]}, {"text": "merhaba", "files": [image, audio]}], # type: ignore
title="Echo Bot",
multimodal=True,
api_name="chat",
)
if __name__ == "__main__":
demo.launch()
|