visual-chatgpt icon indicating copy to clipboard operation
visual-chatgpt copied to clipboard

ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True.

Open xiaoxstz opened this issue 2 years ago • 17 comments

Description

I followed the instruction in the readme file. But I came across the issue below. How to solve it?

(visgpt) λ python visual_chatgpt.py --load ImageCaptioning_cpu,Text2Image_cpu
Initializing VisualChatGPT, load_dict={'ImageCaptioning': 'cpu', 'Text2Image': 'cpu'}
Initializing ImageCaptioning to cpu
Initializing Text2Image to cpu
text_encoder\model.safetensors not found
Fetching 15 files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 15/15 [00:00<00:00, 110183.12it/s]
C:\Users\tanzi\.conda\envs\visgpt\lib\site-packages\transformers\models\clip\feature_extraction_clip.py:28: FutureWarning: The class CLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please use CLIPImageProcessor instead.
  warnings.warn(
`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["id2label"]` will be overriden.
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ D:\Desktop\Projects\AI\visual-chatgpt\visual_chatgpt.py:903 in <module>                          │
│                                                                                                  │
│   900 │   │   clear.click(bot.memory.clear)                                                      │
│   901 │   │   clear.click(lambda: [], None, chatbot)                                             │
│   902 │   │   clear.click(lambda: [], None, state)                                               │
│ ❱ 903 │   │   demo.launch(server_name="localhost", server_port=8090)                             │
│   904                                                                                            │
│                                                                                                  │
│ C:\Users\tanzi\.conda\envs\visgpt\lib\site-packages\gradio\blocks.py:1460 in launch              │
│                                                                                                  │
│   1457 │   │   # If running in a colab or not able to access localhost,                          │
│   1458 │   │   # a shareable link must be created.                                               │
│   1459 │   │   if _frontend and (not networking.url_ok(self.local_url)) and (not self.share):    │
│ ❱ 1460 │   │   │   raise ValueError(                                                             │
│   1461 │   │   │   │   "When localhost is not accessible, a shareable link must be created. Ple  │
│   1462 │   │   │   )                                                                             │
│   1463                                                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True.

Environment

  • Python: 3.8
  • OS: Windows 10
  • pip list
Package                 Version
----------------------- ---------------
absl-py                 1.4.0
accelerate              0.17.1
addict                  2.4.0
aiofiles                23.1.0
aiohttp                 3.8.4
aiosignal               1.3.1
albumentations          1.3.0
altair                  4.2.2
antlr4-python3-runtime  4.9.3
anyio                   3.6.2
async-timeout           4.0.2
attrs                   22.2.0
backports.zoneinfo      0.2.1
basicsr                 1.4.2
blinker                 1.5
braceexpand             0.1.7
cachetools              5.3.0
certifi                 2022.12.7
charset-normalizer      3.1.0
click                   8.1.3
colorama                0.4.6
coloredlogs             15.0.1
contourpy               1.0.7
controlnet-aux          0.0.1
cycler                  0.11.0
dataclasses-json        0.5.7
decorator               5.1.1
diffusers               0.14.0
einops                  0.6.0
entrypoints             0.4
fastapi                 0.95.0
ffmpy                   0.3.0
filelock                3.10.0
flatbuffers             23.3.3
fonttools               4.39.2
frozenlist              1.3.3
fsspec                  2023.3.0
ftfy                    6.1.1
future                  0.18.3
gitdb                   4.0.10
GitPython               3.1.31
google-auth             2.16.2
google-auth-oauthlib    0.4.6
gradio                  3.20.1
greenlet                2.0.2
grpcio                  1.51.3
h11                     0.14.0
httpcore                0.16.3
httpx                   0.23.3
huggingface-hub         0.13.2
humanfriendly           10.0
idna                    3.4
imageio                 2.26.0
imageio-ffmpeg          0.4.8
importlib-metadata      6.1.0
importlib-resources     5.12.0
invisible-watermark     0.1.5
Jinja2                  3.1.2
joblib                  1.2.0
jsonschema              4.17.3
kiwisolver              1.4.4
kornia                  0.6.10
langchain               0.0.101
lazy_loader             0.1
linkify-it-py           2.0.0
lmdb                    1.4.0
Markdown                3.4.1
markdown-it-py          2.2.0
MarkupSafe              2.1.2
marshmallow             3.19.0
marshmallow-enum        1.5.1
matplotlib              3.7.1
mdit-py-plugins         0.3.3
mdurl                   0.1.2
mpmath                  1.3.0
multidict               6.0.4
mypy-extensions         1.0.0
networkx                3.0
numpy                   1.24.2
oauthlib                3.2.2
omegaconf               2.3.0
onnx                    1.13.1
onnxruntime             1.14.1
open-clip-torch         2.16.0
openai                  0.27.2
opencv-python           4.7.0.72
opencv-python-headless  4.7.0.72
orjson                  3.8.7
packaging               23.0
pandas                  1.5.3
Pillow                  9.4.0
pip                     23.0.1
pkgutil_resolve_name    1.3.10
prettytable             3.6.0
protobuf                3.20.3
psutil                  5.9.4
pyarrow                 11.0.0
pyasn1                  0.4.8
pyasn1-modules          0.2.8
pycryptodome            3.17
pydantic                1.10.6
pydeck                  0.8.0
pydub                   0.25.1
Pygments                2.14.0
Pympler                 1.0.1
pyparsing               3.0.9
pyreadline3             3.4.1
pyrsistent              0.19.3
python-dateutil         2.8.2
python-multipart        0.0.6
pytz                    2022.7.1
pytz-deprecation-shim   0.1.0.post0
PyWavelets              1.4.1
PyYAML                  6.0
qudida                  0.0.4
regex                   2022.10.31
requests                2.28.2
requests-oauthlib       1.3.1
rfc3986                 1.5.0
rich                    13.3.2
rsa                     4.9
safetensors             0.3.0
scikit-image            0.20.0
scikit-learn            1.2.2
scipy                   1.9.1
semver                  2.13.0
sentencepiece           0.1.97
setuptools              65.6.3
six                     1.16.0
smmap                   5.0.0
sniffio                 1.3.0
socksio                 1.0.0
SQLAlchemy              1.4.47
starlette               0.26.1
streamlit               1.20.0
sympy                   1.11.1
tb-nightly              2.13.0a20230317
tenacity                8.2.2
tensorboard             2.12.0
tensorboard-data-server 0.7.0
tensorboard-plugin-wit  1.8.1
test-tube               0.7.5
threadpoolctl           3.1.0
tifffile                2023.3.15
timm                    0.6.12
tokenizers              0.13.2
toml                    0.10.2
toolz                   0.12.0
torch                   1.12.1
torchmetrics            0.11.4
torchvision             0.13.1
tornado                 6.2
tqdm                    4.65.0
transformers            4.27.1
typing_extensions       4.5.0
typing-inspect          0.8.0
tzdata                  2022.7
tzlocal                 4.3
uc-micro-py             1.0.1
urllib3                 1.26.15
uvicorn                 0.21.1
validators              0.20.0
watchdog                2.3.1
wcwidth                 0.2.6
webdataset              0.2.43
websockets              10.4
Werkzeug                2.2.3
wheel                   0.38.4
wincertstore            0.2
yapf                    0.32.0
yarl                    1.8.2
zipp                    3.15.0

xiaoxstz avatar Mar 20 '23 04:03 xiaoxstz

Hi @xiaoxstz, have you tried the server_name="0.0.0.0"? Since you use your Windows PC, you can access localhost:8090 via browser.

Wang-Xiaodong1899 avatar Mar 20 '23 07:03 Wang-Xiaodong1899

Did you set proxy( http_proxy or https_proxy) on your machine? I encounter this error on linux(centos 7), and I hava solved by the way below. set no_proxy environment variable on linux shell: export no_proxy="localhost, 127.0.0.1, ::1" or add this line in your app python code: os.environ["no_proxy"] = "localhost,127.0.0.1,::1"

nativexie avatar Mar 21 '23 08:03 nativexie

I have the same problem, but I must use proxy

JaggerH avatar Mar 23 '23 06:03 JaggerH

yes, must use proxy too !

qs-lll avatar Mar 29 '23 10:03 qs-lll

I used proxy, but this error still exist

roostinghawk avatar Apr 03 '23 07:04 roostinghawk

Did you set proxy( http_proxy or https_proxy) on your machine? I encounter this error on linux(centos 7), and I hava solved by the way below. set no_proxy environment variable on linux shell: export no_proxy="localhost, 127.0.0.1, ::1" or add this line in your app python code: os.environ["no_proxy"] = "localhost,127.0.0.1,::1"

In the windows environment, I added set no_proxy=localhost, 127.0.0.1, ::1 in webui-user.bat.And it's worked,thanks.

marb1ee avatar Apr 05 '23 23:04 marb1ee

Thanks!The problem was done.I can watch the site at my laptop and it run at the remote severs.

YZQ7777 avatar Apr 10 '23 13:04 YZQ7777

export no_proxy="localhost, 127.0.0.1, ::1"

::1 on my mac throws another error "ValueError: invalid literal for int() with base 10: ':1'" So I used export no_proxy="localhost, 127.0.0.1"

tedyyu avatar Apr 12 '23 05:04 tedyyu

export no_proxy="localhost, 127.0.0.1, ::1"

::1 on my mac throws another error "ValueError: invalid literal for int() with base 10: ':1'" So I used export no_proxy="localhost, 127.0.0.1"

thank you so much,it worked hahaha

russell-shu avatar May 11 '23 08:05 russell-shu

Did you set proxy( http_proxy or https_proxy) on your machine? I encounter this error on linux(centos 7), and I hava solved by the way below. set no_proxy environment variable on linux shell: export no_proxy="localhost, 127.0.0.1, ::1" or add this line in your app python code: os.environ["no_proxy"] = "localhost,127.0.0.1,::1"

thanks bro, it works😆

ygywzb avatar May 11 '23 22:05 ygywzb

您的来信已经收到啦,祝生活愉快~

russell-shu avatar May 11 '23 22:05 russell-shu

export no_proxy="localhost, 127.0.0.1, ::1"

::1 在我的 Mac 上抛出另一个错误“ValueError:以 10 为底的 int() 的无效文字:':1'”所以我使用了export no_proxy="localhost, 127.0.0.1"

非常感谢,成功了哈哈哈

从哪里插入

alphafa avatar Jun 17 '23 10:06 alphafa

Did you set proxy( http_proxy or https_proxy) on your machine? I encounter this error on linux(centos 7), and I hava solved by the way below. set no_proxy environment variable on linux shell: export no_proxy="localhost, 127.0.0.1, ::1" or add this line in your app python code: os.environ["no_proxy"] = "localhost,127.0.0.1,::1"

It works, thank you!

aidenli avatar Nov 03 '23 09:11 aidenli

I solve this problem in the following way:

I removed the packages: pip uninstall h11 pip uninstall idna pip uninstall httpcore pip uninstall httpx

Then I ran the grid again: pip install gradio

for some reason there is a problem with httpcore

lucas-TagDev avatar Nov 16 '23 15:11 lucas-TagDev

export no_proxy="localhost, 127.0.0.1, ::1"

::1 on my mac throws another error "ValueError: invalid literal for int() with base 10: ':1'" So I used export no_proxy="localhost, 127.0.0.1"

im sorry but I am so confused on where to put this code every time I try to use it in terminal it doesn't work

mkhia avatar Apr 02 '24 00:04 mkhia