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

在streamlit run webui.py的时候出现TypeError: 'NoneType' object is not iterable #2094

Closed
billhan16 opened this issue Nov 17, 2023 · 17 comments
Assignees
Labels
bug Something isn't working

Comments

@billhan16
Copy link

问题描述 / Problem Description
在streamlit run webui.py的时候出现TypeError: 'NoneType' object is not iterable

复现问题的步骤 / Steps to Reproduce

2023-11-17 15:11:56,770 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused
2023-11-17 15:11:56,771 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused
2023-11-17 15:11:56,771 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused
2023-11-17 15:11:56,874 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused
2023-11-17 15:11:56,874 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused
2023-11-17 15:11:56,874 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused
2023-11-17 15:11:56.874 Uncaught app exception
Traceback (most recent call last):
File "/opt/conda/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 541, in _run_script
exec(code, module.dict)
File "/mnt/workspace/Langchain-Chatchat/webui.py", line 64, in
pages[selected_page]["func"](api=api, is_lite=is_lite)
File "/mnt/workspace/Langchain-Chatchat/webui_pages/dialogue/dialogue.py", line 83, in dialogue_page
running_models = list(api.list_running_models())
TypeError: 'NoneType' object is not iterable

环境信息 / Environment Information

  • 是否使用 Docker 部署(是/否):否
  • 使用的模型(ChatGLM2-6B / Qwen-7B 等):ChatGLM-6B / Model used (ChatGLM2-6B / Qwen-7B, etc.): ChatGLM2-6b
  • 使用的 Embedding 模型(moka-ai/m3e-base 等):moka-ai/m3e-base / Embedding model used (moka-ai/m3e-base, etc.):m3e-base
  • 使用的向量库类型 (faiss / milvus / pg_vector 等): faiss / Vector library used (faiss, milvus, pg_vector, etc.): faiss

附加信息 / Additional Information
添加与问题相关的任何其他信息 / Add any other information related to the issue.
在阿里云服务器PAI上运行的,模型下载到服务器上了,config路径也改了

@billhan16 billhan16 added the bug Something isn't working label Nov 17, 2023
@billhan16 billhan16 changed the title [BUG] 简洁阐述问题 / Concise description of the issue 在streamlit run webui.py的时候出现TypeError: 'NoneType' object is not iterable Nov 17, 2023
@Yu-Yang-Li
Copy link

遇到同样的问题

@Yu-Yang-Li
Copy link

#2032 pip install httpx==0.25.0可以解决

问题描述 / Problem Description 在streamlit run webui.py的时候出现TypeError: 'NoneType' object is not iterable

复现问题的步骤 / Steps to Reproduce

2023-11-17 15:11:56,770 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused 2023-11-17 15:11:56,771 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused 2023-11-17 15:11:56,771 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused 2023-11-17 15:11:56,874 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused 2023-11-17 15:11:56,874 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused 2023-11-17 15:11:56,874 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused 2023-11-17 15:11:56.874 Uncaught app exception Traceback (most recent call last): File "/opt/conda/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 541, in _run_script exec(code, module.dict) File "/mnt/workspace/Langchain-Chatchat/webui.py", line 64, in pages[selected_page]["func"](api=api, is_lite=is_lite) File "/mnt/workspace/Langchain-Chatchat/webui_pages/dialogue/dialogue.py", line 83, in dialogue_page running_models = list(api.list_running_models()) TypeError: 'NoneType' object is not iterable

环境信息 / Environment Information

  • 是否使用 Docker 部署(是/否):否
  • 使用的模型(ChatGLM2-6B / Qwen-7B 等):ChatGLM-6B / Model used (ChatGLM2-6B / Qwen-7B, etc.): ChatGLM2-6b
  • 使用的 Embedding 模型(moka-ai/m3e-base 等):moka-ai/m3e-base / Embedding model used (moka-ai/m3e-base, etc.):m3e-base
  • 使用的向量库类型 (faiss / milvus / pg_vector 等): faiss / Vector library used (faiss, milvus, pg_vector, etc.): faiss

附加信息 / Additional Information 添加与问题相关的任何其他信息 / Add any other information related to the issue. 在阿里云服务器PAI上运行的,模型下载到服务器上了,config路径也改了

@ztfoolish
Copy link

同样问题,重装httpx并没有奏效。。。

@zRzRzRzRzRzRzR zRzRzRzRzRzRzR self-assigned this Nov 19, 2023
@zRzRzRzRzRzRzR
Copy link
Collaborator

如果是0.2.7的话先试试本地模型和非openai的在线模型,openai支持有bug

@Ginorva
Copy link

Ginorva commented Nov 21, 2023

试试看重装httpx,版本设定为0.24.1
pip install httpx==0.24.1

@ssbg2
Copy link

ssbg2 commented Nov 22, 2023

我升级到新版本后也出现了这个问题,但是api是可以调通的,已经试过了上面重装httpx的方法

@ShanJianSoda
Copy link

我今天也遇到了这样的问题,理论上来讲没改动,然后我吃个饭,重启就跑不起来了……

(langchain) E:\langchain\Langchain-Chatchat>streamlit run webui.py

  You can now view your Streamlit app in your browser.

  Local URL: http://localhost:8501
  Network URL: http://192.168.1.8:8501

{'base_url': 'http://127.0.0.1:7861', 'timeout': 300.0, 'proxies': {'all://127.0.0.1': None, 'all://localhost': None, 'http://127.0.0.1': None, 'http://': None, 'https://': None, 'all://': None, 'http://localhost': None}}
2023-11-24 13:40:03,792 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:05,826 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:07,865 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:10,013 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:12,056 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:14,105 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:14.106 Uncaught app exception
Traceback (most recent call last):
  File "e:\anaconda3\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 541, in _run_script
    exec(code, module.__dict__)
  File "E:\langchain\Langchain-Chatchat\webui.py", line 85, in <module>
    pages[selected_page]["func"](api=api, is_lite=is_lite)
  File "E:\langchain\Langchain-Chatchat\webui_pages\dialogue\dialogue.py", line 80, in dialogue_page
    running_models = list(api.list_running_models())
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

模型用的是本地的glm3-6b(由程序自己调起)
求解救orz

@ShanJianSoda
Copy link

我今天也遇到了这样的问题,理论上来讲没改动,然后我吃个饭,重启就跑不起来了……

(langchain) E:\langchain\Langchain-Chatchat>streamlit run webui.py

  You can now view your Streamlit app in your browser.

  Local URL: http://localhost:8501
  Network URL: http://192.168.1.8:8501

{'base_url': 'http://127.0.0.1:7861', 'timeout': 300.0, 'proxies': {'all://127.0.0.1': None, 'all://localhost': None, 'http://127.0.0.1': None, 'http://': None, 'https://': None, 'all://': None, 'http://localhost': None}}
2023-11-24 13:40:03,792 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:05,826 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:07,865 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:10,013 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:12,056 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:14,105 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:14.106 Uncaught app exception
Traceback (most recent call last):
  File "e:\anaconda3\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 541, in _run_script
    exec(code, module.__dict__)
  File "E:\langchain\Langchain-Chatchat\webui.py", line 85, in <module>
    pages[selected_page]["func"](api=api, is_lite=is_lite)
  File "E:\langchain\Langchain-Chatchat\webui_pages\dialogue\dialogue.py", line 80, in dialogue_page
    running_models = list(api.list_running_models())
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

模型用的是本地的glm3-6b(由程序自己调起) 求解救orz

我用streamlit跑的,跑不明白
然后刚刚试了试直接用python跑,成了……

@zRzRzRzRzRzRzR
Copy link
Collaborator

更新到最新代码吧,改了一些逻辑

@highroom
Copy link

我今天也遇到了这样的问题,理论上来讲没改动,然后我吃个饭,重启就跑不起来了……

(langchain) E:\langchain\Langchain-Chatchat>streamlit run webui.py

  You can now view your Streamlit app in your browser.

  Local URL: http://localhost:8501
  Network URL: http://192.168.1.8:8501

{'base_url': 'http://127.0.0.1:7861', 'timeout': 300.0, 'proxies': {'all://127.0.0.1': None, 'all://localhost': None, 'http://127.0.0.1': None, 'http://': None, 'https://': None, 'all://': None, 'http://localhost': None}}
2023-11-24 13:40:03,792 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:05,826 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:07,865 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:10,013 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:12,056 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:14,105 - utils.py[line:94] - ERROR: ConnectError: error when post /llm_model/list_running_models: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-11-24 13:40:14.106 Uncaught app exception
Traceback (most recent call last):
  File "e:\anaconda3\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 541, in _run_script
    exec(code, module.__dict__)
  File "E:\langchain\Langchain-Chatchat\webui.py", line 85, in <module>
    pages[selected_page]["func"](api=api, is_lite=is_lite)
  File "E:\langchain\Langchain-Chatchat\webui_pages\dialogue\dialogue.py", line 80, in dialogue_page
    running_models = list(api.list_running_models())
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

模型用的是本地的glm3-6b(由程序自己调起) 求解救orz

一样的问题,求解决办法,已经git pull到最新的代码,还是一样报错

@zhongmiyu99
Copy link

我也遇到了,还是不行。

@cn-marsbian
Copy link

我也有这个问题,有解决方案吗

@tyt327
Copy link

tyt327 commented Jan 5, 2024

有大佬解决了吗?我也这个问题。。。

@JamaisVuu
Copy link

我也遇到了同样的问题

@litongyun233
Copy link

我也遇到了同样的问题

@Sololololo
Copy link

我也是,救命

@sh66666
Copy link

sh66666 commented Apr 29, 2024

所以现在还是没有解决吗

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