text-generation-webui icon indicating copy to clipboard operation
text-generation-webui copied to clipboard

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.

Open nanshaws opened this issue 9 months ago • 3 comments

Describe the bug

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.

Is there an existing issue for this?

  • [X] I have searched the existing issues

Reproduction

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.

Screenshot

截图_20240506142940

Logs

TypeError: replace() argument 1 must be str, not bytes
┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐
│ D:\text-generation-webui-main\server.py:255 in <module>                                                             │
│                                                                                                                     │
│   254         # Launch the web UI                                                                                   │
│ > 255         create_interface()                                                                                    │
│   256         while True:                                                                                           │
│                                                                                                                     │
│ D:\text-generation-webui-main\server.py:161 in create_interface                                                     │
│                                                                                                                     │
│   160     with OpenMonkeyPatch():                                                                                   │
│ > 161         shared.gradio['interface'].launch(                                                                    │
│   162             max_threads=64,                                                                                   │
│                                                                                                                     │
│ D:\text-generation-webui-main\installer_files\env\Lib\site-packages\gradio\blocks.py:2305 in launch                 │
│                                                                                                                     │
│   2304         ):                                                                                                   │
│ > 2305             raise ValueError(                                                                                │
│   2306                 "When localhost is not accessible, a shareable link must be created. Ple                     │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
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.

System Info

Windows10
RTX 3050
i7-11800H

nanshaws avatar May 06 '24 06:05 nanshaws

I think this is the same issue. https://github.com/oobabooga/text-generation-webui/issues/5975

Bedoshady avatar May 06 '24 22:05 Bedoshady

If you use a proxy server in Windows, you may need to set HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables.

import os
from urllib.request import getproxies

proxies = getproxies()
os.environ["http_proxy"]  = proxies["http"]
os.environ["https_proxy"] = proxies["https"]
os.environ["no_proxy"]    = "localhost, 127.0.0.1/8, ::1"

Accurio avatar Jun 28 '24 07:06 Accurio

If you use a proxy server in Windows, you may need to set HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables.

import os
from urllib.request import getproxies

proxies = getproxies()
os.environ["http_proxy"]  = proxies["http"]
os.environ["https_proxy"] = proxies["https"]
os.environ["no_proxy"]    = "localhost, 127.0.0.1/8, ::1"

you are right

nanshaws avatar Aug 01 '24 09:08 nanshaws