File size: 523 Bytes
5f03826
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import time

import gradio as gr


def bot(message, history):
    out = []
    for word in "This is a test.".split():
        out.append(word)
        time.sleep(1)
        yield " ".join(out)


examples = [
    {
        "text": "hey",
        "files": ["cats.jpg", "dogs.jpg"],
    },
]

demo = gr.ChatInterface(
    fn=bot,
    multimodal=True,
    textbox=gr.MultimodalTextbox(
        file_types=["image"],
        file_count="multiple",
    ),
    examples=examples,
    cache_examples=False,
)
demo.queue().launch()