Langchain-Chatchat icon indicating copy to clipboard operation
Langchain-Chatchat copied to clipboard

运行webui后报TypeError

Open sh66666 opened this issue 1 year ago • 5 comments

问题描述 / Problem Description 严格按照readme部署,运行startup后ui界面无法打开,运行webui报TypeError, 6c6a71a87b9348e079d59df506fe2a0 可能原因是模型没加载成功,但是我又运行了一边大模型,问答都正常 39a7c9f0606b76cb1cc2cdc47f39026 实在不知道怎么解决了,求助

预期的结果 / Expected Result webui界面正常打开

实际结果 / Actual Result webui报错

环境信息 / Environment Information

  • langchain-ChatGLM 版本/commit 号:最新版
  • 是否使用 Docker 部署(是/否):否 / Is Docker deployment used (yes/no): yes
  • 使用的模型(ChatGLM2-6B / Qwen-7B 等): Qwen-7B,
  • 使用的 Embedding 模型(moka-ai/m3e-base 等):bge-large-v1.5
  • Python 版本 / Python version:3.11,3.10

sh66666 avatar Apr 28 '24 13:04 sh66666

The TypeError you're encountering, where a 'NoneType' object is not iterable, typically occurs when an expected iterable object (like a list or dictionary) returns None instead. This issue might be related to how the application handles data that should be iterable but isn't, due to unexpected conditions or errors in data fetching or processing.

To address this issue, consider implementing checks to ensure that the data you're attempting to iterate over is not None. For example, before iterating over a list or dictionary, verify that it is not None. If you're working with a function or method that's expected to return an iterable but might return None, you can handle this case gracefully by checking the return value before proceeding with iteration.

Additionally, review the application's logic related to data loading and processing, especially around the areas indicated by the error traceback. There might be a need to debug the application to pinpoint the exact location where the NoneType object is being incorrectly used. Adding print statements or using a debugger can help trace the program's execution flow and identify where the error occurs.

If the issue persists, consider revisiting the repository's issues and discussions for similar problems and their resolutions. Sometimes, compatibility issues with specific models or configurations can lead to unexpected behavior, so ensuring that all components are correctly configured and compatible with each other is crucial.

Lastly, ensure your environment matches the requirements for the application, including the correct Python version and dependencies. Sometimes, discrepancies in the environment can lead to subtle bugs and errors.

Details

Sources


About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

dosubot[bot] avatar Apr 28 '24 13:04 dosubot[bot]

你localhost:7861这个没有启动,或模型设置没有完整(model_config.py)导致启动后加载的模型列表为空

hanwsf avatar Apr 29 '24 19:04 hanwsf

你localhost:7861这个没有启动,或模型设置没有完整(model_config.py)导致启动后加载的模型列表为空

请问怎么解决呢

sh66666 avatar Apr 30 '24 00:04 sh66666

将本地或在线模型配置上

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年04月30日 08:01 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [chatchat-space/Langchain-Chatchat] 运行webui后报TypeError (Issue #3916) |

你localhost:7861这个没有启动,或模型设置没有完整(model_config.py)导致启动后加载的模型列表为空

请问怎么解决呢

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

hanwsf avatar May 01 '24 03:05 hanwsf

将本地或在线模型配置上 ---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年04月30日 08:01 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [chatchat-space/Langchain-Chatchat] 运行webui后报TypeError (Issue #3916) | 你localhost:7861这个没有启动,或模型设置没有完整(model_config.py)导致启动后加载的模型列表为空 请问怎么解决呢 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

老师你好,我运行wiki给出的镜像也是同样的报错,enableCROS=false的时候就会报错,=true的时候,streamlit就加载不出来,请问这个怎么解决

sh66666 avatar May 01 '24 07:05 sh66666

模型路径换成绝对的

zRzRzRzRzRzRzR avatar May 02 '24 12:05 zRzRzRzRzRzRzR

模型路径换成绝对的

老师你好,我一直用的就是绝对路径,原先运行startup一直加载不出来,我在startup文件中加入enableCORS false之后,可以运行-a,但是运行-w仍然是相同的报错,请问这是什么原因

sh66666 avatar May 02 '24 13:05 sh66666

遇到了相同的问题,把server/utils.py中的以下代码

`def fschat_controller_address() -> str: from configs.server_config import FSCHAT_CONTROLLER

host = FSCHAT_CONTROLLER["host"]
if host == "0.0.0.0":
    host = "127.0.0.1"
port = FSCHAT_CONTROLLER["port"]
return f"http://{host}:{port}"`

改成了 `def fschat_controller_address() -> str: from configs.server_config import FSCHAT_CONTROLLER

host = FSCHAT_CONTROLLER["host"]
if host == "0.0.0.0":
    host = "0.0.0.0"
port = FSCHAT_CONTROLLER["port"]
return f"http://{host}:{port}"`

之后解决了,原本的问题是127.0.0.1只能本地访问,而我使用了远程服务器

vio938 avatar May 29 '24 03:05 vio938