-
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
Fix API info bug #9700
Fix API info bug #9700
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/870c22ce13472c98531e7c2bdf2dcc180f8aed0d/gradio-5.1.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@870c22ce13472c98531e7c2bdf2dcc180f8aed0d#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/870c22ce13472c98531e7c2bdf2dcc180f8aed0d/gradio-client-1.7.0.tgz Use Lite from this PR <script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/870c22ce13472c98531e7c2bdf2dcc180f8aed0d/dist/lite.js""></script> |
🦄 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.
|
Sorry @freddyaboulton can you explain why we need to do this? What bug is this PR addressing? |
I noticed that the api_info route stores references to values in the config dict. So it's possible for code in the info route to change values in the config. So it's better if we copy the data (only once) prior to making any modifications. |
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.
tested and lgtm for now, but this will further degrade performance for apps with large numbers of api endpoints, so I think we should switch to #9574 soon
I'll go ahead and get this in so that we have fewer open PRs, thanks @freddyaboulton! |
Description
We should copy the api_info prior to modifying the urls for file-based components. This copy only happens once.
🎯 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