File size: 419 Bytes
79fbe1c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr


# MultimodalTextbox in ChatInterface - validation error is invisible
def validate_input(x):
    return gr.validate(x["text"] != "error", "Can't be error")


def do_chat(message, history):
    yield "You typed: " + message["text"]


demo = gr.ChatInterface(
    fn=do_chat,
    validator=validate_input,
    multimodal=True,
    show_progress="full",
)

if __name__ == "__main__":
    demo.launch()