hysts's picture
hysts HF Staff
Add reproduction app for gradio#13663 (before fix)
c54e0fb verified
Raw
History Blame Contribute Delete
733 Bytes
import gradio as gr
DESCRIPTION = """\
Reproduction for [gradio#13663](https://github.com/gradio-app/gradio/issues/13663).
The chat function is a generator that returns without yielding anything when the
message is `skip`.
1. Send `hello`. The bot streams `hi`.
2. Send `skip`.
**Before the fix (this Space):** the event errors out with
`RuntimeError: async generator raised StopAsyncIteration`.
**After the fix:** no bot response, the conversation above stays intact, and the
textbox is re-enabled.
"""
def chat(message, history):
if message == "skip":
return
yield "hi"
demo = gr.ChatInterface(chat, title="gradio#13663", description=DESCRIPTION)
if __name__ == "__main__":
demo.launch(ssr_mode=False)