We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chatbot stream output can't render markdown properly. It seems that '\n' char is stripped during streaming.
import gradio as gr import time with gr.Blocks() as demo: chatbot = gr.Chatbot(type="messages", render_markdown=True) msg = gr.Textbox() clear = gr.Button("Clear") def user(user_message, history: list): return "", history + [{"role": "user", "content": user_message}] def bot(history: list): bot_message = "What's your choice?\n - A\n - B\n - C\n" history.append({"role": "assistant", "content": "One time output: "+bot_message+"\n\nStream output: "}) for character in bot_message: history[-1]['content'] += character time.sleep(0.05) yield history msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then( bot, chatbot, chatbot ) clear.click(lambda: None, None, chatbot, queue=False) demo.launch(server_name='0.0.0.0')
No response
Gradio Environment Information: ------------------------------ Operating System: Linux gradio version: 5.1.0 gradio_client version: 1.4.0 ------------------------------------------------ gradio dependencies in your environment: aiofiles: 23.2.1 anyio: 4.6.0 fastapi: 0.115.0 ffmpy: 0.4.0 gradio-client==1.4.0 is not installed. httpx: 0.27.2 huggingface-hub: 0.25.1 jinja2: 3.1.4 markupsafe: 2.1.5 numpy: 2.1.2 orjson: 3.10.7 packaging: 24.1 pandas: 2.2.3 pillow: 10.4.0 pydantic: 2.9.2 pydub: 0.25.1 python-multipart: 0.0.12 pyyaml: 6.0.2 ruff: 0.6.9 semantic-version: 2.10.0 tomlkit==0.12.0 is not installed. typer: 0.12.5 typing-extensions: 4.12.2 urllib3: 2.2.3 uvicorn: 0.31.0 authlib; extra == 'oauth' is not installed. itsdangerous; extra == 'oauth' is not installed. gradio_client dependencies in your environment: fsspec: 2024.9.0 httpx: 0.27.2 huggingface-hub: 0.25.1 packaging: 24.1 typing-extensions: 4.12.2 websockets: 12.0
I can work around it
The text was updated successfully, but these errors were encountered:
Thanks for filing! This is a duplicate of #9679
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Chatbot stream output can't render markdown properly. It seems that '\n' char is stripped during streaming.
Have you searched existing issues? 🔎
Reproduction
Screenshot
Logs
No response
System Info
Severity
I can work around it
The text was updated successfully, but these errors were encountered: