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

Hot Reload issues in jupyter notebook #8586

Closed
1 task done
shao918516 opened this issue Jun 20, 2024 · 0 comments · Fixed by #8599
Closed
1 task done

Hot Reload issues in jupyter notebook #8586

shao918516 opened this issue Jun 20, 2024 · 0 comments · Fixed by #8599
Assignees
Labels
bug Something isn't working

Comments

@shao918516
Copy link

Describe the bug

when I use jupyter nobebook with hot reloading/Auto-Reloading, occured this problem:
截图 2024-06-20 17-28-00
AttributeError: 'JupyterReloader' object has no attribute 'queue_changed'

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

# in jupyter notebook
%load_ext gradio

%%blocks

import gradio as gr

with gr.Blocks() as demo:
    gr.Markdown(f"# Greetings {args.name}!")
    inp = gr.Textbox()
    out = gr.Textbox()

    inp.change(fn=lambda x: x, inputs=inp, outputs=out)

Screenshot

截图 2024-06-20 17-28-00

Logs

No response

System Info

AttributeError                            Traceback (most recent call last)
Cell In[25], line 1
----> 1 get_ipython().run_cell_magic('blocks', '', '\nimport gradio as gr\n\nwith gr.Blocks() as demo:\n    gr.Markdown(f"# Greetings {args.name}!")\n    inp = gr.Textbox()\n    out = gr.Textbox()\n\n    inp.change(fn=lambda x: x, inputs=inp, outputs=out)\n')

File ~/program/anaconda3/envs/pytorch/lib/python3.12/site-packages/IPython/core/interactiveshell.py:2517, in InteractiveShell.run_cell_magic(self, magic_name, line, cell)
   2515 with self.builtin_trap:
   2516     args = (magic_arg_s, cell)
-> 2517     result = fn(*args, **kwargs)
   2519 # The code below prevents the output from being displayed
   2520 # when using magics with decorator @output_can_be_silenced
   2521 # when the last Python token in the expression is a ';'.
   2522 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):

File ~/program/anaconda3/envs/pytorch/lib/python3.12/site-packages/gradio/ipython_ext.py:83, in load_ipython_extension.<locals>.blocks(line, cell, local_ns)
     81     demo.launch(share=args.share)
     82     reloader.track(demo)
---> 83 elif reloader.queue_changed(demo):
     84     print("Queue got added or removed. Restarting demo.")
     85     reloader.running_demo.close()

AttributeError: 'JupyterReloader' object has no attribute 'queue_changed'

Severity

Blocking usage of gradio

@shao918516 shao918516 added the bug Something isn't working label Jun 20, 2024
@abidlabs abidlabs changed the title Hot Reload issues Hot Reload issues in jupyter notebook Jun 20, 2024
@freddyaboulton freddyaboulton self-assigned this Jun 24, 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

Successfully merging a pull request may close this issue.

2 participants