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

gr.render with triggers occurs bug #10205

Closed
1 task done
BLESS11186 opened this issue Dec 16, 2024 · 1 comment · Fixed by #10212
Closed
1 task done

gr.render with triggers occurs bug #10205

BLESS11186 opened this issue Dec 16, 2024 · 1 comment · Fixed by #10212
Labels
bug Something isn't working Priority High priority issues Regression Bugs did not exist in previous versions of Gradio

Comments

@BLESS11186
Copy link

Describe the bug

After update to 5.9.0 gr.render makes error.
I think there is a problem with this PR(#10190).
To check if trigger.callback is None is needed.

gradio/gradio/renderable.py:149

if trigger.callback:
    trigger.callback(trigger.__self__) # type: ignore

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

with gr.Blocks() as demo:
    with gr.Row():
        n = gr.Number(0)
        btn = gr.Button("Click me")

    @gr.render(inputs=[n], triggers=[btn.click])
    def _render(n):
        for i in range(n):
            gr.Textbox(str(i))

demo.launch()

Screenshot

No response

Logs

Traceback (most recent call last):
  File ".../test_app.py", line 8, in <module>
    @gr.render(inputs=[n], triggers=[btn.click])
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../anaconda3/envs/gradio-test/lib/python3.12/site-packages/gradio/renderable.py", line 149, in render
    trigger.callback(trigger.__self__)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable

System Info

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 5.9.0
gradio_client version: 1.5.2

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

aiofiles: 23.2.1
anyio: 4.6.2.post1
audioop-lts is not installed.
fastapi: 0.115.5
ffmpy: 0.4.0
gradio-client==1.5.2 is not installed.
httpx: 0.27.2
huggingface-hub: 0.26.2
jinja2: 3.1.4
markupsafe: 2.1.5
numpy: 2.1.3
orjson: 3.10.11
packaging: 24.2
pandas: 2.2.3
pillow: 10.4.0
pydantic: 2.9.2
pydub: 0.25.1
python-multipart: 0.0.19
pyyaml: 6.0.2
ruff: 0.7.4
safehttpx: 0.1.6
semantic-version: 2.10.0
starlette: 0.41.3
tomlkit: 0.12.0
typer: 0.13.1
typing-extensions: 4.12.2
urllib3: 2.2.3
uvicorn: 0.32.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2024.10.0
httpx: 0.27.2
huggingface-hub: 0.26.2
packaging: 24.2
typing-extensions: 4.12.2
websockets: 12.0

Severity

Blocking usage of gradio

@BLESS11186 BLESS11186 added the bug Something isn't working label Dec 16, 2024
@abidlabs
Copy link
Member

cc @aliabid94

@abidlabs abidlabs added Regression Bugs did not exist in previous versions of Gradio Priority High priority issues labels Dec 16, 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 Priority High priority issues Regression Bugs did not exist in previous versions of Gradio
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants