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

[BUG] 运行python startup.py --all-webui 打不开网页 #1650

Closed
maamzhe opened this issue Oct 3, 2023 · 2 comments
Closed

[BUG] 运行python startup.py --all-webui 打不开网页 #1650

maamzhe opened this issue Oct 3, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@maamzhe
Copy link

maamzhe commented Oct 3, 2023

问题描述 / Problem Description
config文件改好了模型路径,但运行startup.py仍有错误。

复现问题的步骤 / Steps to Reproduce
1.改好了config文件,更改的内容有:

MODEL_PATH = {
    "embed_model": {
        ......
        "m3e-base": r"D:\document\a_postgraduate\20231003langchain\m3e-base",
        ......}
     "llm_model": {
        ......
        "chatglm2-6b-int4": r"D:\document\a_postgraduate\20230918ChatGLM2-6B\ChatGLM2-6B\models\chatglm2-6b-int4",
        ......
# 选用的 Embedding 名称
EMBEDDING_MODEL = "m3e-base" # 可以尝试最新的嵌入式sota模型:piccolo-large-zh
# Embedding 模型运行设备。设为"auto"会自动检测,也可手动设定为"cuda","mps","cpu"其中之一。
EMBEDDING_DEVICE = "cuda"
# LLM 名称
LLM_MODEL = "chatglm2-6b-int4"
# LLM 运行设备。设为"auto"会自动检测,也可手动设定为"cuda","mps","cpu"其中之一。
LLM_DEVICE = "cuda"

2.执行 '在新建的虚拟环境中,cd到startup.py的目录下,输入'python startup.py --all-webui'(详见最后贴出的anaconda prompt的完整内容)
3.回车运行,出现了很多提示消息,主要是api连接不上,但我使用的是本地部署的chatglm2-6b-int4,这个模型单独运行是可以的,可以正常对话(也会报错,但没有影响使用)

预期的结果 / Expected Result
弹出网页,与大模型对话界面

实际结果 / Actual Result
弹出网页,网页上啥也没有。anaconda prompt对话框里一大堆报错(具体见下面完整报错提示)

环境信息 / Environment Information

  • langchain-ChatGLM 版本/commit 号:langchain版本:0.0.306. fastchat版本:0.2.29
  • 是否使用 Docker 部署(是/否):否 / Is Docker deployment used (yes/no): no
  • 使用的模型(ChatGLM2-6B / Qwen-7B 等):ChatGLM2-6B-int4
  • 使用的 Embedding 模型(moka-ai/m3e-base 等):m3e-base
  • 使用的向量库类型 (faiss / milvus / pg_vector 等): faiss / Vector library used (faiss, milvus, pg_vector, etc.): 不知道
  • 操作系统及版本 / Operating system and version:win11
  • Python 版本 / Python version:3.10.13
  • 其他相关环境信息 / Other relevant environment information:

附加信息 / Additional Information
附加信息有两部分,第一部分是anaconda prompt完整的内容,第二部分是log记录的错误。
第一部分,anaconda prompt完整的内容:(这部分我仔细看了,大概分为几块,为了方便大家查看,把我认为的分块用加粗标注出来)

(langchain) D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat>python startup.py --all-webui

==============================Langchain-Chatchat Configuration==============================
操作系统:Windows-10-10.0.22621-SP0.
python版本:3.10.13 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:24:38) [MSC v.1916 64 bit (AMD64)]
项目版本:v0.2.5
langchain版本:0.0.306. fastchat版本:0.2.29

当前使用的分词器:ChineseRecursiveTextSplitter
当前启动的LLM模型:['chatglm2-6b-int4'] @ cuda
{'device': 'cuda',
'host': '0.0.0.0',
'infer_turbo': False,
'model_path': 'D:\document\a_postgraduate\20230918ChatGLM2-6B\ChatGLM2-6B\models\chatglm2-6b-int4',
'port': 20002}
当前Embbedings模型: m3e-base @ cuda
==============================Langchain-Chatchat Configuration==============================

2023-10-03 20:59:19 | INFO | root | 正在启动服务:
2023-10-03 20:59:19 | INFO | root | 如需查看 llm_api 日志,请前往 D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\logs
Process api_worker - zhipu-api:
Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 203, in _new_conn
sock = connection.create_connection(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 85, in create_connection
raise err
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
OSError: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 790, in urlopen
response = self._make_request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 496, in _make_request
conn.request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 395, in request
self.endheaders()
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1278, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1038, in _send_output
self.send(msg)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 976, in send
self.connect()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 243, in connect
self.sock = self._new_conn()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 218, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000001E814046170>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001E814046170>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 366, in run_model_worker
app = create_model_worker_app(log_level=log_level, **kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 92, in create_model_worker_app
worker = worker_class(model_names=args.model_names,
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\zhipu.py", line 23, in init
super().init(**kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\base.py", line 43, in init
self.init_heart_beat()
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\base.py", line 67, in init_heart_beat
self.register_to_controller()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\fastchat\serve\model_worker.py", line 118, in register_to_controller
r = requests.post(url, json=data)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001E814046170>: Failed to establish a new connection: [WinError 10049] 在其上下文中, 该请求的地址无效。'))
Process api_worker - minimax-api:
Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 203, in _new_conn
sock = connection.create_connection(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 85, in create_connection
raise err
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
OSError: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 790, in urlopen
response = self._make_request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 496, in _make_request
conn.request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 395, in request
self.endheaders()
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1278, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1038, in _send_output
self.send(msg)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 976, in send
self.connect()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 243, in connect
self.sock = self._new_conn()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 218, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000001A389C36110>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001A389C36110>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 366, in run_model_worker
app = create_model_worker_app(log_level=log_level, **kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 92, in create_model_worker_app
worker = worker_class(model_names=args.model_names,
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\minimax.py", line 23, in init
super().init(**kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\base.py", line 43, in init
self.init_heart_beat()
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\base.py", line 67, in init_heart_beat
self.register_to_controller()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\fastchat\serve\model_worker.py", line 118, in register_to_controller
r = requests.post(url, json=data)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001A389C36110>: Failed to establish a new connection: [WinError 10049] 在其上下文中, 该请求的地址无效。'))
Process api_worker - xinghuo-api:
Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 203, in _new_conn
sock = connection.create_connection(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 85, in create_connection
raise err
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
OSError: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 790, in urlopen
response = self._make_request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 496, in _make_request
conn.request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 395, in request
self.endheaders()
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1278, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1038, in _send_output
self.send(msg)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 976, in send
self.connect()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 243, in connect
self.sock = self._new_conn()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 218, in _new_conn
raise NewConnectionError(
Process api_worker - qianfan-api:
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000001CCC0AFA080>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001CCC0AFA080>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 366, in run_model_worker
app = create_model_worker_app(log_level=log_level, **kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 92, in create_model_worker_app
worker = worker_class(model_names=args.model_names,
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\xinghuo.py", line 39, in init
super().init(**kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\base.py", line 43, in init
self.init_heart_beat()
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\base.py", line 67, in init_heart_beat
self.register_to_controller()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\fastchat\serve\model_worker.py", line 118, in register_to_controller
r = requests.post(url, json=data)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001CCC0AFA080>: Failed to establish a new connection: [WinError 10049] 在其上下文中, 该请求的地址无效。'))
Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 203, in _new_conn
sock = connection.create_connection(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 85, in create_connection
raise err
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
OSError: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 790, in urlopen
response = self._make_request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 496, in _make_request
conn.request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 395, in request
self.endheaders()
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1278, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1038, in _send_output
self.send(msg)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 976, in send
self.connect()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 243, in connect
self.sock = self._new_conn()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 218, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x00000202B099A0B0>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x00000202B099A0B0>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 366, in run_model_worker
app = create_model_worker_app(log_level=log_level, **kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 92, in create_model_worker_app
worker = worker_class(model_names=args.model_names,
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\qianfan.py", line 121, in init
super().init(**kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\base.py", line 43, in init
self.init_heart_beat()
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\base.py", line 67, in init_heart_beat
self.register_to_controller()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\fastchat\serve\model_worker.py", line 118, in register_to_controller
r = requests.post(url, json=data)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x00000202B099A0B0>: Failed to establish a new connection: [WinError 10049] 在其上下文中, 该请求的地址无效。'))
Process api_worker - fangzhou-api:
Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 203, in _new_conn
sock = connection.create_connection(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 85, in create_connection
raise err
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
OSError: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 790, in urlopen
response = self._make_request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 496, in _make_request
conn.request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 395, in request
self.endheaders()
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1278, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1038, in _send_output
self.send(msg)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 976, in send
self.connect()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 243, in connect
self.sock = self._new_conn()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 218, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000001C612E1E020>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001C612E1E020>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 366, in run_model_worker
app = create_model_worker_app(log_level=log_level, **kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 92, in create_model_worker_app
worker = worker_class(model_names=args.model_names,
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\fangzhou.py", line 70, in init
super().init(**kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\base.py", line 43, in init
self.init_heart_beat()
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\base.py", line 67, in init_heart_beat
self.register_to_controller()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\fastchat\serve\model_worker.py", line 118, in register_to_controller
r = requests.post(url, json=data)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001C612E1E020>: Failed to establish a new connection: [WinError 10049] 在其上下文中, 该请求的地址无效。'))
Process api_worker - qwen-api:
Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 203, in _new_conn
sock = connection.create_connection(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 85, in create_connection
raise err
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
OSError: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 790, in urlopen
response = self._make_request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 496, in _make_request
conn.request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 395, in request
self.endheaders()
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1278, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1038, in _send_output
self.send(msg)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 976, in send
self.connect()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 243, in connect
self.sock = self._new_conn()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 218, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000001AF30F8A050>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001AF30F8A050>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self.kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 366, in run_model_worker
app = create_model_worker_app(log_level=log_level, **kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 92, in create_model_worker_app
worker = worker_class(model_names=args.model_names,
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\qwen.py", line 69, in init
super().init(**kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\base.py", line 43, in init
self.init_heart_beat()
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\server\model_workers\base.py", line 67, in init_heart_beat
self.register_to_controller()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\fastchat\serve\model_worker.py", line 118, in register_to_controller
r = requests.post(url, json=data)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001AF30F8A050>: Failed to establish a new connection: [WinError 10049] 在其上下文中, 该请求的地址无效。'))
2023-10-03 20:59:31 | ERROR | stderr | INFO: Started server process [27032]
2023-10-03 20:59:31 | ERROR | stderr | INFO: Waiting for application startup.
2023-10-03 20:59:31 | ERROR | stderr | INFO: Application startup complete.
2023-10-03 20:59:31 | ERROR | stderr | INFO: Uvicorn running on http://0.0.0.0:20000 (Press CTRL+C to quit)
2023-10-03 20:59:34 | WARNING | transformers_modules.chatglm2-6b-int4.quantization | Failed to load cpm_kernels:No module named 'cpm_kernels'
2023-10-03 20:59:35 | WARNING | transformers_modules.chatglm2-6b-int4.quantization | Load parallel cpu kernel failed C:\Users\mz.cache\huggingface\modules\transformers_modules\chatglm2-6b-int4\quantization_kernels_parallel.so: Traceback (most recent call last):
File "C:\Users\mz/.cache\huggingface\modules\transformers_modules\chatglm2-6b-int4\quantization.py", line 149, in init
kernels = ctypes.cdll.LoadLibrary(kernel_file)
File "D:\Anaconda3202309\envs\langchain\lib\ctypes_init
.py", line 452, in LoadLibrary
return self.dlltype(name)
File "D:\Anaconda3202309\envs\langchain\lib\ctypes_init
.py", line 374, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 不是有效的 Win32 应用程序。

2023-10-03 20:59:36 | WARNING | transformers_modules.chatglm2-6b-int4.quantization | Load cpu kernel C:\Users\mz.cache\huggingface\modules\transformers_modules\chatglm2-6b-int4\quantization_kernels.so failed: Traceback (most recent call last):
File "C:\Users\mz/.cache\huggingface\modules\transformers_modules\chatglm2-6b-int4\quantization.py", line 166, in init
kernels = ctypes.cdll.LoadLibrary(kernel_file)
File "D:\Anaconda3202309\envs\langchain\lib\ctypes_init_.py", line 452, in LoadLibrary
return self.dlltype(name)
File "D:\Anaconda3202309\envs\langchain\lib\ctypes_init
.py", line 374, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 不是有效的 Win32 应用程序。

Process model_worker - chatglm2-6b-int4:
Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 203, in _new_conn
sock = connection.create_connection(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 85, in create_connection
raise err
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
OSError: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 790, in urlopen
response = self._make_request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 496, in _make_request
conn.request(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 395, in request
self.endheaders()
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1278, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 1038, in _send_output
self.send(msg)
File "D:\Anaconda3202309\envs\langchain\lib\http\client.py", line 976, in send
self.connect()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 243, in connect
self.sock = self._new_conn()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connection.py", line 218, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000002B3441E11E0>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。

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

Traceback (most recent call last):
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002B3441E11E0>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "D:\Anaconda3202309\envs\langchain\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 366, in run_model_worker
app = create_model_worker_app(log_level=log_level, **kwargs)
File "D:\document\a_postgraduate\20231003langchain\Langchain-Chatchat\startup.py", line 194, in create_model_worker_app
worker = ModelWorker(
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\fastchat\serve\model_worker.py", line 242, in init
self.init_heart_beat()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\fastchat\serve\model_worker.py", line 101, in init_heart_beat
self.register_to_controller()
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\fastchat\serve\model_worker.py", line 118, in register_to_controller
r = requests.post(url, json=data)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "C:\Users\mz\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=20001): Max retries exceeded with url: /register_worker (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002B3441E11E0>: Failed to establish a new connection: [WinError 10049] 在其上下文中, 该请求的地址无效。'))

第二部分,log记录的错误
2023-10-03 20:59:31 | ERROR | stderr | �[32mINFO�[0m: Started server process [�[36m27032�[0m]
2023-10-03 20:59:31 | ERROR | stderr | �[32mINFO�[0m: Waiting for application startup.
2023-10-03 20:59:31 | ERROR | stderr | �[32mINFO�[0m: Application startup complete.
2023-10-03 20:59:31 | ERROR | stderr | �[32mINFO�[0m: Uvicorn running on �[1mhttp://0.0.0.0:20000�[0m (Press CTRL+C to quit)

@maamzhe maamzhe added the bug Something isn't working label Oct 3, 2023
@ftyh2005
Copy link

ftyh2005 commented Oct 4, 2023

各服务器默认绑定host。如改为"0.0.0.0"需要修改下方所有XX_SERVER的host

DEFAULT_BIND_HOST = "127.0.0.1"

改下这里就不报错了,不过又遇到了其他问题

@maamzhe
Copy link
Author

maamzhe commented Oct 5, 2023

各服务器默认绑定host。如改为"0.0.0.0"需要修改下方所有XX_SERVER的host

DEFAULT_BIND_HOST = "127.0.0.1"

我在server_config.py文件中改了这个地址,然后就可以用了。谢谢你。我猜可能是我电脑默认设置之类的问题,本机地址转换不过去?希望你也能解决你遇到的问题。

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

3 participants