-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix loading interface with examples #2640
Conversation
All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-2640-all-demos |
476144b
to
025a9b2
Compare
Thanks for creating this PR @freddyaboulton! Agreed that this would fix the issue in all new Spaces created, but this doesn't solve the bug for loading existing Spaces that have examples. I think we should fix that as well -- is that possible? I.e. if you run import gradio as gr
io = gr.Interface.load("spaces/abidlabs/test-calculator-2") with this branch, it still doesn't work |
Good point @abidlabs ! Modified |
@@ -296,6 +296,8 @@ async def cache(self) -> None: | |||
if self.batch: | |||
output = [value[0] for value in output] | |||
cache_logger.flag(output) | |||
Context.root_block.dependencies.remove(dependency) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to add a comment here similar to what you added in blocks.py
to explain why we're removing the dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done - thanks @abidlabs !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @freddyaboulton!
Description
Fixes #2638
Test with: https://huggingface.co/spaces/freddyaboulton/calculator. This is a space created with this PR.
Checklist:
A note about the CHANGELOG
Hello 馃憢 and thank you for contributing to Gradio!
All pull requests must update the change log located in CHANGELOG.md, unless the pull request is labeled with the "no-changelog-update" label.
Please add a brief summary of the change to the Upcoming Release > Full Changelog section of the CHANGELOG.md file and include
a link to the PR (formatted in markdown) and a link to your github profile (if you like). For example, "* Added a cool new feature by
[@myusername](link-to-your-github-profile)
in[PR 11111](https://github.com/gradio-app/gradio/pull/11111)
".If you would like to elaborate on your change further, feel free to include a longer explanation in the other sections.
If you would like an image/gif/video showcasing your feature, it may be best to edit the CHANGELOG file using the
GitHub web UI since that lets you upload files directly via drag-and-drop.