有没有佬知道、streamlit run webui.py的时候出现TypeError: ‘NoneType‘ object is not iterable咋解决哇
fiveyyy 2024-07-08 17:03:01 阅读 55
在阿里云服务器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 对应版本可能就会成功(云服务器不能成功)。
上一篇: C语言进阶——自定义类型:枚举、联合
本文标签
有没有佬知道、streamlit run webui.py的时候出现TypeError: ‘NoneType‘ object is not iterable咋解决哇
声明
本文内容仅代表作者观点,或转载于其他网站,本站不以此文作为商业用途
如有涉及侵权,请联系本站进行删除
转载本站原创文章,请注明来源及作者。