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

Upgrade gradio #1930

Merged
merged 2 commits into from
Jul 9, 2024
Merged

Upgrade gradio #1930

merged 2 commits into from
Jul 9, 2024

Conversation

AllentDan
Copy link
Collaborator

Please note for gradio>4. The proxy policy was changed. You may get httpcore.ConnectTimeout: timed out of _do_normal_analytics_request function.

@lvhan028 lvhan028 self-requested a review July 5, 2024 08:56
@lvhan028
Copy link
Collaborator

lvhan028 commented Jul 5, 2024

I've set proxy off

Traceback (most recent call last):
  File "/opt/py38/bin/lmdeploy", line 33, in <module>
    sys.exit(load_entry_point('lmdeploy', 'console_scripts', 'lmdeploy')())
  File "/workspace/lmdeploy/lmdeploy/cli/entrypoint.py", line 36, in run
    args.run(args)
  File "/workspace/lmdeploy/lmdeploy/cli/serve.py", line 259, in gradio
    run(args.model_path_or_server,
  File "/workspace/lmdeploy/lmdeploy/serve/gradio/app.py", line 58, in run
    run_local(model_path_or_server,
  File "/workspace/lmdeploy/lmdeploy/serve/gradio/turbomind_coupled.py", line 232, in run_local
    demo.queue(
  File "/opt/py38/lib/python3.8/site-packages/gradio/blocks.py", line 2420, in launch
    raise ValueError(
ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to allow access to localhost.

@lvhan028
Copy link
Collaborator

lvhan028 commented Jul 5, 2024

Please offer a guide about usage.

@AllentDan
Copy link
Collaborator Author

I could not reproduce the error. May refer to chenfei-wu/TaskMatrix#250

@lvhan028
Copy link
Collaborator

lvhan028 commented Jul 5, 2024

I could not reproduce the error. May refer to chenfei-wu/TaskMatrix#250

I tried, but still got failure. My gradio version is 4.37.2

@AllentDan
Copy link
Collaborator Author

AllentDan commented Jul 5, 2024

How about you try lmdeploy serve gradio model_path --share

@lvhan028
Copy link
Collaborator

lvhan028 commented Jul 5, 2024

How about you try lmdeploy serve gradio model_path --share

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/py38/lib/python3.8/site-packages/gradio/analytics.py", line 70, in _do_normal_analytics_request
    data["ip_address"] = get_local_ip_address()
  File "/opt/py38/lib/python3.8/site-packages/gradio/analytics.py", line 131, in get_local_ip_address
    ip_address = httpx.get(
  File "/opt/py38/lib/python3.8/site-packages/httpx/_api.py", line 198, in get
    return request(
  File "/opt/py38/lib/python3.8/site-packages/httpx/_api.py", line 106, in request
    return client.request(
  File "/opt/py38/lib/python3.8/site-packages/httpx/_client.py", line 827, in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/opt/py38/lib/python3.8/site-packages/httpx/_client.py", line 914, in send
    response = self._send_handling_auth(
  File "/opt/py38/lib/python3.8/site-packages/httpx/_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
  File "/opt/py38/lib/python3.8/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
    response = self._send_single_request(request)
  File "/opt/py38/lib/python3.8/site-packages/httpx/_client.py", line 1015, in _send_single_request
    response = transport.handle_request(request)
  File "/opt/py38/lib/python3.8/site-packages/httpx/_transports/default.py", line 233, in handle_request
    resp = self._pool.handle_request(req)
  File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/opt/py38/lib/python3.8/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectTimeout: timed out

@AllentDan
Copy link
Collaborator Author

AllentDan commented Jul 5, 2024

Please note for gradio>4. The proxy policy was changed. You may get httpcore.ConnectTimeout: timed out of _do_normal_analytics_request function.

I've mentioned this, but it was introduced by gradio>4 and proxy. It does not influence usage. It can't be reproduced in my local machine.

@lvhan028
Copy link
Collaborator

lvhan028 commented Jul 8, 2024

Please note for gradio>4. The proxy policy was changed. You may get httpcore.ConnectTimeout: timed out of _do_normal_analytics_request function.

I've mentioned this, but it was introduced by gradio>4 and proxy. It does not influence usage. It can't be reproduced in my local machine.

Try the docker image

@AllentDan
Copy link
Collaborator Author

Try the docker image

Tested OK except the log info httpx.ConnectTimeout: timed out.

@lvhan028 lvhan028 requested a review from irexyc July 9, 2024 03:29
@lvhan028
Copy link
Collaborator

lvhan028 commented Jul 9, 2024

Can you share the way to launch the server?
It is 100% reproducible at my side

@lvhan028
Copy link
Collaborator

lvhan028 commented Jul 9, 2024

Can you share the way to launch the server? It is 100% reproducible at my side

Now I understand that

httpx.ConnectTimeout: timed out happened but didn't affect the usage.

@lvhan028 lvhan028 merged commit af3bdae into main Jul 9, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants