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

Gradio launch( share=True ) Not working !!! #2918

Closed
1 task done
kareemgamalmahmoud opened this issue Jan 3, 2023 · 11 comments
Closed
1 task done

Gradio launch( share=True ) Not working !!! #2918

kareemgamalmahmoud opened this issue Jan 3, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@kareemgamalmahmoud
Copy link

kareemgamalmahmoud commented Jan 3, 2023

Describe the bug

When I tried the official Colab notebook with this setup :

gradio.Interface(fn=greet, inputs="text", outputs="text").launch(share=True)

The cell works without issuing any public link.

Is there an existing issue for this?

  • I have searched the existing issues

Reproduction

GRADIO: Hello World.ipynb

Screenshot

image

Logs

No Logs

System Info

Google Colab env.

Severity

annoying

@kareemgamalmahmoud kareemgamalmahmoud added the bug Something isn't working label Jan 3, 2023
@adilrahman
Copy link

I am also facing this issue
alternative solution:- you can launch that in local env by setting share=False then you can use this command for port forwarding !npx localtunnel --port <your-local-port>

@pazkero
Copy link

pazkero commented Jan 3, 2023

By the way, forcing a downgrade (I used Gradio 3.9) still works ─ It seems only Gradio 3.14+ is broken.

Setting up a public link... we have recently upgraded the way public links are generated. If you encounter any problems, please report the issue and downgrade to gradio version 3.13.0

@sjstone2838
Copy link

sjstone2838 commented Jan 3, 2023

I am also experiencing this issue, trying to run gradio in a databricks notebook - the command just runs indefinitely and a public link is never generated
image

@pazkero
Copy link

pazkero commented Jan 3, 2023

Related/Useful:

tsukimiya commented 16 hours ago
This seems to be a gradio problem.
gradio changed the network method in 3.13, but probably due to a fault, it can no longer get the URL from the connection and freezes at this location.

while url == "":
line = self.proc.stdout.readline()
line = line.decode("utf-8")
if "start proxy success" in line:
url = re.search("start proxy success: (.+)\n", line).group(1)

...
gradio connects to the host:port described in https://api.gradio.app/v2/tunnel-request and gets the URL ( (hash).gradio.live ) to use.
However, there has been no response from this host since about 2023-01-02 06:20:00 (UTC), and the URL cannot be obtained.

@abidlabs
Copy link
Member

abidlabs commented Jan 3, 2023

Hey folks, thanks for creating this issue. Gradio's sharing servers were indeed down for the last 12 hours. It seems like we had an unexpected amount of traffic and the servers buckled under the load. We've restarted everything and they seem to be working fine now. I'll go ahead and close this issue for now, but please let us know if you still continue to experience this at all.

@ShadeRedeye
Copy link

i use,stable-diffusion in paperspace and looks like in latest ver(or maybe in 3.10-latest),it make interface got hang,and some image can't use functionally (such result,send to img2img etc),i try rollback to 3.9 and everything is work again

@abidlabs
Copy link
Member

abidlabs commented Jan 8, 2023

Hi @ShadeRedeye, if you can create a small demo with what is not working (along with any error longs), that would be helpful for us to understand the issue

@ShadeRedeye
Copy link

@abidlabs hmm creating small demo seems difficult for me,but i can give you link to a demo stable-diffusion-webui that i use in paperspace

here :
https://github.com/Engineer-of-Stuff/stable-diffusion-paperspace/blob/master/StableDiffusionUI_Voldemort_paperspace.ipynb

based some issue,it said in the latest ver,gradio can't proxy file larger than 2mb when web-UI share to internet (AKA set Share=true).
Engineer-of-Stuff/stable-diffusion-paperspace#49

when using ngrok will goin fix issue,it also make having problem,bcoz paperspace didn't like tunneling proxy like that.

what i can to make it normal again,is when i reverting gradio ver to 3.9

@wchao1115
Copy link

Hey @abidlabs , I also run into this issue with 3.16.2. It only gives out local URL despite setting demo.launch(share=True). You should be able to run my repro hosted in replit: https://replit.com/@metarooster/Model-UI#modui.py. The launch call is literally the last line in the source file. Please advise.

@SondosBsharat
Copy link

Hey, I don't know if any one of you faced this issue or not, actually the demo.launch() command keeps running for more than one hour and it did not finish, is this normal? and I need to wait more? or there is an issue somewhere?
Note: my model is not that heavy

@Kefan-pauline
Copy link

Kefan-pauline commented Jul 24, 2023

I still encountered this behavior with gradio==3.38.0 in a remote notebook that is different from colab, kaggle, sagemaker etc.

The following code

import gradio as gr

def greet(name):
    return "Hello " + name + "!"

demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch(share=True)

outputs only Running on local URL: http://127.0.0.1:7860/, and the kernel keeps busy. If I terminate the kernel manually, I got

KeyboardInterrupt Traceback (most recent call last)
Cell In [34], line 1
----> 1 demo.launch(share=True)

File /usr/local/lib/python3.8/dist-packages/gradio/blocks.py:1932, in Blocks.launch(self, inline, inbrowser, share, debug, enable_queue, max_threads, auth, auth_message, prevent_thread_lock, show_error, server_name, server_port, show_tips, height, width, encrypt, favicon_path, ssl_keyfile, ssl_certfile, ssl_keyfile_password, ssl_verify, quiet, show_api, file_directories, allowed_paths, blocked_paths, root_path, _frontend, app_kwargs)
1930 try:
1931 if self.share_url is None:
-> 1932 self.share_url = networking.setup_tunnel(
1933 self.server_name, self.server_port, self.share_token
1934 )
1935 print(strings.en["SHARE_LINK_DISPLAY"].format(self.share_url))
1936 if not (quiet):

File /usr/local/lib/python3.8/dist-packages/gradio/networking.py:190, in setup_tunnel(local_host, local_port, share_token)
186 remote_host, remote_port = payload["host"], int(payload["port"])
187 tunnel = Tunnel(
188 remote_host, remote_port, local_host, local_port, share_token
189 )
--> 190 address = tunnel.start_tunnel()
191 return address
192 except Exception as e:

File /usr/local/lib/python3.8/dist-packages/gradio/tunneling.py:59, in Tunnel.start_tunnel(self)
57 def start_tunnel(self) -> str:
58 self.download_binary()
---> 59 self.url = self._start_tunnel(BINARY_PATH)
60 return self.url

File /usr/local/lib/python3.8/dist-packages/gradio/tunneling.py:95, in Tunnel._start_tunnel(self, binary)
93 if self.proc.stdout is None:
94 continue
---> 95 line = self.proc.stdout.readline()
96 line = line.decode("utf-8")
97 if "start proxy success" in line:

KeyboardInterrupt:

Any idea how can I display the gradio interface in the notebook? @abidlabs Thanks a lot!

Note: this code snippet works for gradio==3.9 in my environment.

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

No branches or pull requests

9 participants