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

[本地部署]: 本地部署报超时 #1085

Closed
2 tasks done
KrystalandBarry opened this issue Mar 27, 2024 · 4 comments
Closed
2 tasks done

[本地部署]: 本地部署报超时 #1085

KrystalandBarry opened this issue Mar 27, 2024 · 4 comments
Labels
localhost deployment question Further information is requested

Comments

@KrystalandBarry
Copy link

是否已存在现有反馈与解答?

  • 我确认没有已有issue或discussion,且已阅读常见问题

是否是一个代理配置相关的疑问?

  • 我确认这不是一个代理配置相关的疑问。

错误描述

本地部署后,改了apikey,能正常启动,但对话报超时

复现操作

本地部署后,改了apikey,能正常启动,但对话报超时
image

错误日志

Traceback (most recent call last):
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/urllib3/util/connection.py", line 95, in create_connection
    raise err
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection
    sock.connect(sa)
TimeoutError: [Errno 60] Operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 715, in urlopen
    httplib_response = self._make_request(
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 404, in _make_request
    self._validate_conn(conn)
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1058, in _validate_conn
    conn.connect()
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/urllib3/connection.py", line 363, in connect
    self.sock = conn = self._new_conn()
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/urllib3/connection.py", line 179, in _new_conn
    raise ConnectTimeoutError(
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x122583700>, 'Connection to openaipublic.blob.core.windows.net timed out. (connect timeout=None)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 799, in urlopen
    retries = retries.increment(
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x122583700>, 'Connection to openaipublic.blob.core.windows.net timed out. (connect timeout=None)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/modules/models/base_model.py", line 668, in predict
    for chatbot, status_text in iter:
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/modules/models/base_model.py", line 347, in stream_next_chatbot
    user_token_count = self.count_token(inputs)
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/modules/models/OpenAI.py", line 62, in count_token
    input_token_count = count_token(construct_user(user_input))
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/modules/utils.py", line 164, in count_token
    encoding = tiktoken.get_encoding("cl100k_base")
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/tiktoken/registry.py", line 73, in get_encoding
    enc = Encoding(**constructor())
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/tiktoken_ext/openai_public.py", line 72, in cl100k_base
    mergeable_ranks = load_tiktoken_bpe(
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/tiktoken/load.py", line 147, in load_tiktoken_bpe
    contents = read_file_cached(tiktoken_bpe_file, expected_hash)
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/tiktoken/load.py", line 64, in read_file_cached
    contents = read_file(blobpath)
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/tiktoken/load.py", line 25, in read_file
    resp = requests.get(blobpath)
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/Users/dingtao/work/hpr/ai/code/ChuanhuChatGPT/venv/lib/python3.10/site-packages/requests/adapters.py", line 507, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x122583700>, 'Connection to openaipublic.blob.core.windows.net timed out. (connect timeout=None)'))

运行环境

- OS: 
- Browser: 
- Gradio version: 
- Python version:

补充说明

No response

@KrystalandBarry KrystalandBarry added localhost deployment question Further information is requested labels Mar 27, 2024
@Keldos-Li
Copy link
Collaborator

连接问题,参考 #5.
可以尝试检查 urllib 库和代理配置。

另,这类问题应该在discussion中提问

@KrystalandBarry
Copy link
Author

好的,这个我之前也看了,版本对应urllib也按照那个issue的改了,但还是不行

@KrystalandBarry
Copy link
Author

改了urllib版本,换了美国的ip,也还是不行

@Keldos-Li
Copy link
Collaborator

奇怪了,但大概总是某个环境的问题……

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
localhost deployment question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants