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

Outputs that are larger than 2 MB do not work with share=True #2260

Closed
1 task done
MrNeon opened this issue Sep 14, 2022 · 8 comments · Fixed by #2509
Closed
1 task done

Outputs that are larger than 2 MB do not work with share=True #2260

MrNeon opened this issue Sep 14, 2022 · 8 comments · Fixed by #2509
Assignees
Labels
bug Something isn't working

Comments

@MrNeon
Copy link

MrNeon commented Sep 14, 2022

Describe the bug

When using the shared tunneled link I get this error when receiving outputs that are around 2MB or larger.

Error in Chrome: net::ERR_HTTP2_PROTOCOL_ERROR 200
Screenshot_20220914_140154

Firefox errors too but without any code, just an uncaught exception.

When using localhost or using ngrok to tunnel the connection the issue never happens.

Is there an existing issue for this?

  • I have searched the existing issues

Reproduction

import numpy as np
import gradio as gr
from PIL import Image

im = Image.open("test_image_over_2MB.png")

def get_image():
    return im

with gr.Blocks() as demo:
    image_output = gr.Image()
    image_button = gr.Button("Get")
    image_button.click(get_image, inputs=None, outputs=image_output)

demo.launch(share=True, debug=True)

Screenshot

No response

Logs

No logs

System Info

Gradio version: 3.3
Firefox 104.0
Chrome 105.0.5195.52

Severity

annoying

@MrNeon MrNeon added the bug Something isn't working label Sep 14, 2022
@abidlabs
Copy link
Member

Thanks @MrNeon for the interesting issue. This might be a limitation based on how the sharing servers have been configured. Will take a look and get back to you

@dylancl
Copy link

dylancl commented Sep 19, 2022

Is there any update on this?

@abidlabs abidlabs changed the title Connection error when using share Outputs that are larger than 2 MB do not work with share=True Sep 19, 2022
@abidlabs
Copy link
Member

abidlabs commented Sep 19, 2022

I've been able to reproduce the issue, but haven't been able to find a fix yet. Sorry about that, we are looking to see what could be the problem

@guumaster
Copy link

Not sure if this helps, but if you use ngrok inside Google Colab and use it to point to localhost:7860 and then access through ngrok url instead of gradio.app, it never hangs. Here is the code:

import os
from flask import Flask
from pyngrok import ngrok

ngrok.set_auth_token(ngrok_token) #PUT TOKEN HERE
public_url = ngrok.connect(7860, bind_tls=True).public_url

os.environ["FLASK_ENV"] = "development"
app = Flask(__name__)
app.config["BASE_URL"] = public_url
app.run()

Maybe it helps to see what ngrok is doing differently, unless is a server setting 🤷

@R4ZZ3
Copy link

R4ZZ3 commented Nov 23, 2022

Any estimate when this fix will be live?
Tried to install from this branch but when trying to run I am getting this error. Eagerly waiting for this release

image

@abidlabs
Copy link
Member

abidlabs commented Nov 28, 2022

Hi @R4ZZ3 we're still ironing out some issues related to the FRP branch -- but if you would like to test it out (no guarantee on its stability!) you can do it by installing gradio locally, checking out the branch, and then running this command:

cp gradio/templates/frontend/index.html gradio/templates/frontend/share.html

before you run your Gradio app. Let me know how it goes!

@abidlabs
Copy link
Member

Hi everyone! We've now officially merged in #2509, which should increase the file limits of what can be shared with public links, i.e. share=True. We've tested files up to 75 MB and they work successfully (although with increased latency). We'll be releasing on pypi shortly but if you'd like to try it out, you can install a beta version: pip install gradio==3.12.0b7

@ShadeRedeye
Copy link

ShadeRedeye commented May 1, 2023

i don't know if this relate to a problem,but i got these error during progress,and cause output preview didn't show up,may know why like this happen?

Screenshot_1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants