-
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 image upload #6363
Fix image upload #6363
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/ad0cc31abe0a58e6ce15a3fbfe40294ffc5c0bef/gradio-4.1.2-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@ad0cc31abe0a58e6ce15a3fbfe40294ffc5c0bef#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.
|
@@ -122,7 +122,7 @@ | |||
|
|||
<ImageUploader | |||
bind:active_tool | |||
bind:value={_value} | |||
bind:value |
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.
What was happening is that we were binding to _value
so the value
prop (which is what gets passed to events) was never updated during the upload.
I think this is the right thing to do. By binding to value, _value will automatically be updated. Also the ImageUploaded calls normalise_file
so value will have the right url
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 thanks @freddyaboulton for the nice fix! |
Thanks for the reivew @abidlabs !! |
* Fix upload * add changeset * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* WIP guide * Add remaining * build command * remove pin from guides * add changeset * Tweaks * add changeset * format * Update guides/05_custom-components/07_pdf-component-example.md Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Redesign file upload (#6356) * Textbox and Code Component Blur/Focus Fixes (#6323) * focus and blur events * format * add changeset * fixes * fixes * format --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> * Fix image upload (#6363) * Fix upload * add changeset * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> * Add demo to the beginning * Add example and note about the name * Incorporate feedback --------- Co-authored-by: aliabd <ali.si3luwa@gmail.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: Hannah <hannahblair@users.noreply.github.com> Co-authored-by: Dawood Khan <dawoodkhan82@gmail.com>
Description
Fix image upload
🎯 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