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
Fixes Drag and Drop for Upload #6525
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/f135675966e52c7066411dcede2b1ede1f05f768/gradio-4.9.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@f135675966e52c7066411dcede2b1ede1f05f768#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.
|
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.
Can you modify the model3d_component_events.spec.ts
and maybe write some 2e2 tests for gr.File
? We have some for UploadButton but not File. There's an example of DnD in video_component_events.spec.ts
.
* clog version * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* Fix version in other changelog why do we have 2? * remove changeset
* amend like/dislike logic * add like/dislike to chatbot demo and add e2e test * add changeset * e2e test changes * revert chatbot_component changes * tweak * generate notebooks * tweak --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* feat: make UploadButton accept icon * add changeset * add proxy url prop * add stories --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
…changes to root, glob, or glob_dir (#6550) * Add code * add changeset * add changeset * Add test * fix --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
…6565) * Fix uploaded file wasn't moved to custom temp dir at different disks * add changeset * Update routes.py --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
* Fix the docstring of the `Slider` class * add changeset * Update the JSON file generator to output a new field .styled_description to render the inline code syntax in the description field * add changeset * Update style_types() to deal with backticks and single asterisks * Update the inline style converter to use regex for the curly bracket syntax as well * Revert `style_types()` not to touch the `description` field and update the frontend code to apply styling to such formatted texts on Svelte's side * Apply the inline styler to other `.description` field appearances * Apply the inline styler to `.preprocessing`, `.postprocessing`, `.examples-format`, `.events`, and `*.parameters.doc` * Stop applying HTML styles to the JSON data, instaed apply HTML escaping * Escape HTML tokens in .parameters[]["doc"] too * fixes --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
* Update zh-CN.json * add changeset * format --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
* client with private space * add changeset * lint * add test --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
…unt=single mode (return None rather) (#6607) * Update file_explorer.py Fixing error if nothing selected in file_count=single mode (return None rather) * add changeset * added unit tests --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* remove 2 slider demos * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* fix: configure default encoding as utf-8 * apply doc change for the fix * apply cn doc change for the fix * add changeset * Lint --------- Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* fixes * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* amend trimming logic and return original file when error occurs * add interactive story test * add changeset * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* add show_recording_waveform * add changeset * add animation * Refactor audio component and waveform options * formatting * add margin before audio controls * amend default values * expose gr.WaveformOptions * Tweak waveform options types and handle none * add waveform_options to reverse_audio * tweak bool typing * notebook --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…cy_limit (#6653) * concurrency limit chat interface * add changeset * Update gradio/chat_interface.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Hmm, so the failing functional tests, are actually passing for me locally. Also by re-running these tests I notice some of them are pretty flaky. Specifically any test using the upload endpoint. |
…he container styles (#6726) * Remove the styles from the Image/Video primitive components and Fix the container styles * add changeset * Fix image example size styles * Remove border from image/Example with type=gallery --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Tests are passing now! Ready for re-review @abidlabs @freddyaboulton |
Nice @dawoodkhan82! The issue is fixed for me for the import gradio as gr
def noop(*args):
return None
demo = gr.Interface(
fn=noop,
inputs=[gr.File(), gr.Model3D(), gr.Image()],
outputs=None,
)
demo.launch() |
@dawoodkhan82 and I looked into the issue above, it seems like it only affects |
@abidlabs Fixed, without (hopefully) breaking anything else! |
Awesome @dawoodkhan82 works for me! Thanks for finding the solution. |
I'll go ahead and merge this in so that we can do a patch release with #6693 and this |
Description
Fixes the issue around the mime-type checks in the Upload component, which was causing errors for drag and dropping files.
Closes: #6490
🎯 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