diff --git a/.changeset/dull-garlics-lie.md b/.changeset/dull-garlics-lie.md new file mode 100644 index 0000000000..9aed6983a2 --- /dev/null +++ b/.changeset/dull-garlics-lie.md @@ -0,0 +1,5 @@ +--- +"gradio": patch +--- + +fix:Fix multimode interface double box on file upload diff --git a/gradio/chat_interface.py b/gradio/chat_interface.py index 1bc678e9f6..554e0bd232 100644 --- a/gradio/chat_interface.py +++ b/gradio/chat_interface.py @@ -202,7 +202,10 @@ class ChatInterface(Blocks): with Group(): with Row(): if textbox: - textbox.container = False + if self.multimodal: + submit_btn = None + else: + textbox.container = False textbox.show_label = False textbox_ = textbox.render() if not isinstance(textbox_, (Textbox, MultimodalTextbox)): @@ -469,7 +472,11 @@ class ChatInterface(Blocks): ): for x in message["files"]: history.append([(x,), None]) - if message["text"] is not None and isinstance(message["text"], str): + if message["text"] is None or not isinstance(message["text"], str): + return + elif message["text"] == "" and message["files"] != []: + history.append([None, response]) + else: history.append([message["text"], response]) async def _display_input(