Skip to content

Fix add_text/regenerate return tuple size mismatch in single-model server#3851

Open
Chessing234 wants to merge 1 commit intolm-sys:mainfrom
Chessing234:fix/issue-3783-return-tuple-size
Open

Fix add_text/regenerate return tuple size mismatch in single-model server#3851
Chessing234 wants to merge 1 commit intolm-sys:mainfrom
Chessing234:fix/issue-3783-return-tuple-size

Conversation

@Chessing234
Copy link
Copy Markdown

Bug

Fixes #3783.

In fastchat/serve/gradio_web_server.py, add_text and regenerate have early-return paths that yield a 9-tuple while the normal path returns an 8-tuple. All three callers (textbox.submit, send_btn.click, regenerate_btn.click) wire the output to [state, chatbot, textbox] + btn_list — 8 outputs. The 9-value returns trigger a Gradio output-count mismatch error, so any empty-input submit, conversation-limit hit, or regenerate-without-regen-support crashes the UI.

Root cause

Commit be5db52 (Merge operation & multimodal arena, #3425) removed the image parameter from add_text in the single-model server and dropped the trailing None from the normal return path, but left the same None in the two early-return paths of add_text and the early-return path of regenerate. The extra None was the image slot that no longer exists.

Fix

Drop the leftover None from the three early returns so every path returns the 8 values the output components expect. No other behavior changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return tuple size mismatch in add_text and regenerate causes Gradio errors

1 participant