gradio: Large input files freeze/crash the interface

Describe the bug

Hi, In my usecase a user uploads a rather large file (300-500mb) and it freezes the app for several seconds which makes for a very bad user experience. It happens after selecting a large file to a gradio File block. It freezes again when pressing a button that processes this data. Is there a way to circumvent this behaviour? It is running locally, as far as a I know are those sizes not supported anyway non-locally right? Currently am hosting my app on AWS. Would be cool if you could fix this behaviour, very much appreciated 😃

Is there an existing issue for this?

  • I have searched the existing issues

Reproduction

def test():
    return

with gr.Blocks() as demo:
    inp = gr.File(label="Input")
    vis_out=gr.File(label="output")
    with gr.Row():
        btn = gr.Button("Run")
    btn.click(fn=test, inputs=[inp], outputs=[vis_out])
demo.launch() 

Then just add a large file as the input.

Screenshot

No response

Logs

no logs

System Info

gradio v 3.4.0, occurs with different os on which the app is hosted,e.g. linux and mac 
also across browsers, chrome takes a long time, mozilla even crashes

Severity

serious, but I can work around it

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

I worked around that and the fact that I cant upload files larger than 500mb by creating my own upload to aws s3 via html, but it took me quite a while… fixing this would be a major upgrade!

@alvindaiyan this seems out of scope for a core Gradio component. But we are working on a way to create customizable components, and this could be a good use case for that.

+1 to the request! Tried implementing a model uploader with gradio.File, but it unsurprisingly crashes the app when uploading 5GB model checkpoints 😅