Skip to content
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

Unable to correctly handle file download with multiple deployments #10583

Open
1 task done
jamie0725 opened this issue Feb 13, 2025 · 1 comment
Open
1 task done

Unable to correctly handle file download with multiple deployments #10583

jamie0725 opened this issue Feb 13, 2025 · 1 comment
Labels
bug Something isn't working cloud Issues that only happen when deploying Gradio on cloud services

Comments

@jamie0725
Copy link

Describe the bug

I notice a weird problem while using the download functionality inside gr.File() when I deploy my app in multiple pods.

Consider the following case and two pods:

Image
  • I have a function that processes user requests which generates an Excel file at the end, the process is handled by pod A, so the file is stored locally inside pod A.
  • Now the user wants to click download, but sometimes this download request is handled by pod B. Therefore, the file download request will fail since the file is never generated in pod B.
  • If the user clicks the download button multiple times, he will eventually download the file successfully -- when the download request is handled by pod A.

Although gr.File() can take a URL as input/output, for corporate scenarios, we can't upload the file to somewhere public.

What I can think of in the first place is that, when I finish generating the file, I upload it to a private GCS bucket, and when the user clicks download, I download it from GCS so I can ensure every pod has the file ready.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

Screenshot

No response

Logs

System Info

5.16.0

Severity

Blocking usage of gradio

@jamie0725 jamie0725 added the bug Something isn't working label Feb 13, 2025
@jamie0725
Copy link
Author

jamie0725 commented Feb 13, 2025

Alternatively, is there a way to ensure the file download request is handled by the same pod as where the file is generated?

@abidlabs, sorry for bothering again...

@abidlabs abidlabs added the cloud Issues that only happen when deploying Gradio on cloud services label Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cloud Issues that only happen when deploying Gradio on cloud services
Projects
None yet
Development

No branches or pull requests

2 participants