-
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
Few File component drag and drop #7141
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/7d24b83282c0203e79067fee47e77f5af7ba00b8/gradio-4.16.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@7d24b83282c0203e79067fee47e77f5af7ba00b8#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.
|
@dawoodkhan82 #7132 is already fixed, so I've removed it from the parent comment, and I think we can reduce some of the changes in this PR as a result |
Thanks @dawoodkhan82. I tested this and can confirm that the original issue is fixed. However, the drag-and-drop doesn't seem to work with file extensions. Here's the repro: import gradio as gr
def generate_file(file_obj):
return None
inputs = gr.components.File( file_types = [ '.jpg', '.mov' ] )
outputs = gr.components.File()
demo = gr.Interface(fn=generate_file, inputs=inputs, outputs=outputs)
demo.launch() If you try dragging-and-dropping |
@abidlabs Should be fixed now |
Extensions work but hmm now the original repro isn't working for me: import gradio as gr
def generate_file(file_obj):
return None
inputs = gr.components.File( file_types = [ 'image', 'video' ] )
outputs = gr.components.File()
demo = gr.Interface(fn=generate_file, inputs=inputs, outputs=outputs)
demo.launch() |
@abidlabs Ah yes I see what's going wrong. Need to pass both the file extension and file type of the uploaded file. Pushing a fix now. |
@abidlabs Can you double check and make sure it works for you now? |
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.
Nice! Works for me now @dawoodkhan82 thanks
Description
Closes: #7094
🎯 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