-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add Upload Button #2591
Add Upload Button #2591
Conversation
Very cool @dawoodkhan82! I think this can be very useful in general (and also closes #2062 by the way). A high-level question: have you considered whether |
Yeah I thought about this. It didn't make sense to create a parameter on the |
All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-2591-all-demos |
I don't know if it makes sense to have both |
@pngwn what is |
|
@pete do you mean |
Oh yeah, I meant the various uploads we have i guess. In this case it seems |
I'm on the fence about combining One other suggestion though -- in the same way that a |
I don't really think they should be merged, I don't think that have overlapping APIs and that could be confusing. The only reason I raise it is that we have rejected component requests in the past for being too niche, I don't know which Upload (Button or File) is the most useful but having both seems overkill. And I don't want us to get into a situation where we overlook this discrepancy when we need something (for whatever reason) but outside contributors have their proposals rejected. Typically we've told people to wait for custom components when this has happened in the past. I'm not against the idea of an UploadButton particularly. |
Hmm could it be possible, to add more style parameters to the |
I synced with @dawoodkhan82 on this a bit, and here's what we're thinking:
|
Maybe |
Thanks for the fix @dawoodkhan82 -- I can confirm that |
@abidlabs Actually using |
Hmm not a fan of The other thing is that I think this parameter (button_label or label) should be the first argument, so that you could instantiate an
rather than having to do:
|
Just seeing this now - I agree with @pngwn's original opinion that this should just be a kwarg to the File component. Especially the variant solution, that seems very clean. I think the |
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 besides small comments
Pointed out a few remaining nits, but otherwise looks great. Very cool @dawoodkhan82! I would suggest creating a demo using the |
Did another round of testing and looks good @dawoodkhan82! Awesome PR |
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Description
Add an upload button component. Like file upload but in button form. Main use case is for the new improved chatbot coming soon.
Not sure about the style of the button.
Screen.Recording.2022-11-02.at.3.42.57.AM.mov
Please include:
Closes: #2062
Checklist:
A note about the CHANGELOG
Hello 👋 and thank you for contributing to Gradio!
All pull requests must update the change log located in CHANGELOG.md, unless the pull request is labeled with the "no-changelog-update" label.
Please add a brief summary of the change to the Upcoming Release > Full Changelog section of the CHANGELOG.md file and include
a link to the PR (formatted in markdown) and a link to your github profile (if you like). For example, "* Added a cool new feature by
[@myusername](link-to-your-github-profile)
in[PR 11111](https://github.com/gradio-app/gradio/pull/11111)
".If you would like to elaborate on your change further, feel free to include a longer explanation in the other sections.
If you would like an image/gif/video showcasing your feature, it may be best to edit the CHANGELOG file using the
GitHub web UI since that lets you upload files directly via drag-and-drop.