-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Lazy load interactive or static variants of a component individually, rather than loading both variants regardless. This change will improve performance for many applications. #5215
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/5028cf9dd453c7d5ce34fd396f79b4f3051d406c/gradio-3.40.1-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@5028cf9dd453c7d5ce34fd396f79b4f3051d406c#subdirectory=client/python" |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
Dno whats going on with the guides, will revert those changes before merging. |
In the sync you mentioned that this PR still needs some fixes to handle |
@abidlabs READY FOR REVIEW!!! |
@pngwn Don't think updating
|
I'll take a look! |
I think this is because now we're loading the appropriate interactive/static version once at load time, right? One issue I noticed is that even as an output component, the dataframe component still allows for editing the component. Seems like this issue was introduced before this PR though. Otherwise looks great! |
I added some logic to load new components (if necessary when @dawoodkhan82 it should work now, if you can retest. @aliabid94 I think i broke the dataframe in my refactor. Fixed that here as well. |
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.
Looks great to me!
@pngwn tested and it works great now! |
Description
Lazy load only the interactive or static variant of a component as required rather than loading both. This needs a follow up or two but works well.
Closes: #3360
🎯 PRs Should Target Issues
Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.
Not adhering to this guideline will result in the PR being closed.
Tests
PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests:
bash scripts/run_all_tests.sh
You may need to run the linters:
bash scripts/format_backend.sh
andbash scripts/format_frontend.sh