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] 简洁阐述问题 / Concise description of the issueTraceback (most recent call last): File "/data/soft/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script exec(code, module.__dict__) File "/data/chenhui/text_similarity_main/Langchain-Chatchat/webui.py", line 64, in <module> pages[selected_page]["func"](api=api, is_lite=is_lite) File "/data/chenhui/text_similarity_main/Langchain-Chatchat/webui_pages/dialogue/dialogue.py", line 163, in dialogue_page running_models = list(api.list_running_models()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not iterable 报错的原因,给我正确的答案 #3042

Closed
caiji2019-cai opened this issue Feb 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@caiji2019-cai
Copy link

问题描述 / Problem Description
用简洁明了的语言描述这个问题 / Describe the problem in a clear and concise manner.

复现问题的步骤 / Steps to Reproduce

  1. 执行 '...' / Run '...'
  2. 点击 '...' / Click '...'
  3. 滚动到 '...' / Scroll to '...'
  4. 问题出现 / Problem occurs

预期的结果 / Expected Result
描述应该出现的结果 / Describe the expected result.

实际结果 / Actual Result
描述实际发生的结果 / Describe the actual result.

环境信息 / Environment Information

  • langchain-ChatGLM 版本/commit 号:(例如:v2.0.1 或 commit 123456) / langchain-ChatGLM version/commit number: (e.g., v2.0.1 or commit 123456)
  • 是否使用 Docker 部署(是/否):是 / Is Docker deployment used (yes/no): yes
  • 使用的模型(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.): moka-ai/m3e-base
  • 使用的向量库类型 (faiss / milvus / pg_vector 等): faiss / Vector library used (faiss, milvus, pg_vector, etc.): faiss
  • 操作系统及版本 / Operating system and version:
  • Python 版本 / Python version:
  • 其他相关环境信息 / Other relevant environment information:

附加信息 / Additional Information
添加与问题相关的任何其他信息 / Add any other information related to the issue.

@caiji2019-cai caiji2019-cai added the bug Something isn't working label Feb 22, 2024
Copy link

dosubot bot commented Feb 22, 2024

🤖

嘿,@caiji2019-cai! 又见面了,希望这次也能帮到你!

根据您提供的错误信息,问题出现在 list_running_models() 函数中,当尝试对 None 对象进行迭代时,会出现 TypeError: 'NoneType' object is not iterable 错误。这可能是因为 api.list_running_models() 返回了 None,而不是预期的模型列表。

这可能有以下几个原因:

  1. controller_address + "/list_models" 端点没有返回包含 "models" 键的 JSON 数据。
  2. controller_address + "/list_models" 端点返回了包含 "models" 键的响应,但值为 None。
  3. client.post(controller_address + "/list_models") 请求存在问题,导致没有返回正确的响应。

要解决此问题,您需要调试 controller_address + "/list_models" 端点和 client.post(controller_address + "/list_models") 请求,确保它们按预期工作并返回模型列表。如果端点或请求没有问题,您可以在迭代之前添加检查以确保 models 不为 None:

models = r.json().get("models")
if models is None:
    logger.error('No models returned from controller')
    return BaseResponse(code=500, data={}, msg='No models returned from controller')
data = {m: get_model_config(m).data for m in models}

此外,我在 Langchain-Chatchat 仓库中找到了一些类似的已解决问题,可能对您有所帮助:

  1. an unexpected keyword argument 'proxy_ssl_context' TypeError: 'NoneType' object is not iterable
  2. ERROR: TypeError: Caught exception: object of type 'NoneType' has no len()
  3. 运行报错

希望这些信息能帮助您解决问题。如果问题仍然存在,或者您有其他问题,欢迎随时向我提问。

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.

If you want to continue the conversation, start your reply with @dosu-bot.

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

2 participants