Spaces:
Sleeping
Sleeping
| 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() |