当前位置:首页 » 《关注互联网》 » 正文

有没有佬知道、streamlit run webui.py的时候出现TypeError: ‘NoneType‘ object is not iterable咋解决哇

0 人参与  2024年05月25日 19:12  分类 : 《关注互联网》  评论

点击全文阅读


在阿里云服务器PAI上运行的,基于chatglm3-6b的langchain-chatglm具体错误如下:

#  streamlit run webui.py --server.address 127.0.0.1

Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.


  You can now view your Streamlit app in your browser.

  URL: http://127.0.0.1:8501

/usr/local/lib/python3.10/dist-packages/langchain/chat_models/__init__.py:31: LangChainDeprecationWarning: Importing chat models from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

`from langchain_community.chat_models import ChatOpenAI`.

To install langchain-community run `pip install -U langchain-community`.
  warnings.warn(
/usr/local/lib/python3.10/dist-packages/langchain/llms/__init__.py:548: LangChainDeprecationWarning: Importing LLMs from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

`from langchain_community.llms import OpenAI`.

To install langchain-community run `pip install -U langchain-community`.
  warnings.warn(
/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_config.py:334: UserWarning: Valid config keys have changed in V2:
* 'schema_extra' has been renamed to 'json_schema_extra'
  warnings.warn(message, UserWarning)
/usr/local/lib/python3.10/dist-packages/langchain/document_loaders/__init__.py:36: LangChainDeprecationWarning: Importing document loaders from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

`from langchain_community.document_loaders import JSONLoader`.

To install langchain-community run `pip install -U langchain-community`.
  warnings.warn(
2024-04-23 22:18:46,588 - utils.py[line:95] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused
2024-04-23 22:18:46,588 - utils.py[line:95] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused
2024-04-23 22:18:46,589 - utils.py[line:95] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused
2024-04-23 22:18:46,692 - utils.py[line:95] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused
2024-04-23 22:18:46,692 - utils.py[line:95] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused
2024-04-23 22:18:46,693 - utils.py[line:95] - ERROR: ConnectError: error when post /llm_model/list_running_models: [Errno 111] Connection refused
2024-04-23 22:18:46.693 Uncaught app exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
    exec(code, module.__dict__)
  File "/mnt/workspace/langchain-ChatGLM/webui.py", line 64, in <module>
    pages[selected_page]["func"](api=api, is_lite=is_lite)
  File "/mnt/workspace/langchain-ChatGLM/webui_pages/dialogue/dialogue.py", line 163, in dialogue_page
    running_models = list(api.list_running_models())
TypeError: 'NoneType' object is not iterable
 

尝试了github上的方法:

1、改python 运行

2、重装httpx: pip install httpx==0.25.0

都失败了。

二编#################

如果python startup.py -a报错长这样,显示驱动版本过旧,阿里云上部署的A10的云服务器就ok咯,本地化上部署可能是torch gpu版本不匹配,查询cpu型号,重新在pytorch官网上 pip install 对应版本可能就会成功(云服务器不能成功)。


点击全文阅读


本文链接:http://zhangshiyu.com/post/113590.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1