Skip to content
New issue

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

Using gr.Markdown as output of gr.Button disables the loading spinner #10165

Closed
1 task done
maxkskhor opened this issue Dec 10, 2024 · 2 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@maxkskhor
Copy link

maxkskhor commented Dec 10, 2024

Describe the bug

Using gr.Markdown as output of gr.Button disables the loading spinner.

The spinner works in other components such as gr.Textbox or gr.HTML.

The loading spinner worked in Gradio 4.42.0 but doesn't work in Gradio 5.8.0.

The user would not know if the app is running as the loading spinner is not working for gr.Markdown.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr
import time


def func(x):
    time.sleep(5)
    return x


with gr.Blocks() as demo:
    text = gr.Textbox()
    # output = gr.Textbox()
    output = gr.Markdown()

    run = gr.Button('Run')
    run.click(
        fn=func,
        inputs=[text],
        outputs=[output]
    )


if __name__ == '__main__':
    demo.launch()
  

Screenshot

image

Logs

No logs. It is a UI issue.

System Info

Gradio Environment Information:
------------------------------
Operating System: Windows
gradio version: 5.8.0
gradio_client version: 1.5.1

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
anyio: 4.7.0
audioop-lts is not installed.
fastapi: 0.115.6
ffmpy: 0.4.0
gradio-client==1.5.1 is not installed.
httpx: 0.28.1
huggingface-hub: 0.26.5
jinja2: 3.1.4
markupsafe: 2.1.5
numpy: 2.2.0
orjson: 3.10.12
packaging: 24.2
pandas: 2.2.3
pillow: 10.4.0
pydantic: 2.10.3
pydub: 0.25.1
python-multipart: 0.0.19
pyyaml: 6.0.2
ruff: 0.8.2
safehttpx: 0.1.6
semantic-version: 2.10.0
starlette: 0.41.3
tomlkit: 0.12.0
typer: 0.15.1
typing-extensions: 4.12.2
urllib3: 2.2.3
uvicorn: 0.32.1
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2024.10.0
httpx: 0.28.1
huggingface-hub: 0.26.5
packaging: 24.2
typing-extensions: 4.12.2
websockets: 12.0

Severity

I can work around it.

@maxkskhor maxkskhor added the bug Something isn't working label Dec 10, 2024
@maxkskhor maxkskhor changed the title Using gr.Markdown as output of a function disables the loading spinner Using gr.Markdown as output of gr.Button disables the loading spinner Dec 10, 2024
@maxkskhor
Copy link
Author

maxkskhor commented Dec 10, 2024

Found a solution. Set the height to say 100 gr.Markdown(height=100) would make the loading spinner work again.

@abidlabs
Copy link
Member

Hi @maxkskhor yes the gr.Markdown needs to be a minimum height (either explicitly set as you did, or based on its content) for the loading spinner to appear.

@abidlabs abidlabs closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants