gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
33.42k stars 2.53k forks source link

Order of files selected while uploading cannot be maintained with gr.File(interactive=True) #7314

Closed schoudhary101 closed 8 months ago

schoudhary101 commented 8 months ago

When doing multiple files upload at once, the order of the files are in ascending order of name while it cannot be in the order the user selects. Hope this can be implemented.

If not possible, then in the UI, the user should be able to rearrange the order of files.

abidlabs commented 8 months ago

Hi @schoudhary101 I think this would be a great case for a custom component!

we've made it possible for Gradio users to create their own custom components -- meaning that you can write some Python and JavaScript (Svelte), and publish it as a Gradio component. You can use it in your own Gradio apps, or share it so that anyone can use it in their Gradio apps.

Here's an example of a Gradio custom component: https://github.com/PhyscalX/gradio-image-prompter -- it lets you upload images and process points or draw boxes on top of the image.

You could do something similar here and create a custom OrderedFile gradio custom component templating off of the File component

If you'd like to create your own, we've put together a Guide: https://www.gradio.app/guides/five-minute-guide, and we're happy to help.

abidlabs commented 8 months ago

I'll go ahead and close this issue for now