chatchat-space / Langchain-Chatchat

Langchain-Chatchat(原Langchain-ChatGLM)基于 Langchain 与 ChatGLM, Qwen 与 Llama 等语言模型的 RAG 与 Agent 应用 | Langchain-Chatchat (formerly langchain-ChatGLM), local knowledge based LLM (like ChatGLM, Qwen and Llama) RAG and Agent app with langchain
Apache License 2.0
31.96k stars 5.56k forks source link

[BUG] 使用在线embedding时出现’AttributeError: module 'server.model_workers.qwen' has no attribute 'can_embedding'‘ #3880

Closed cccusername closed 6 months ago

cccusername commented 6 months ago

问题描述 / Problem Description 使用在线embedding模型时,说类没有can_embedding这个方法,但是确实是有的,直接导入就是正常的 51df7835dedc66f36d114c65733d67c

环境信息 / Environment Information

dosubot[bot] commented 6 months ago

看起来您遇到的问题可能与Python环境或模块路径设置有关,导致无法正确访问can_embedding()方法。这个方法在qwen模块中确实存在,但在动态获取QenWorker类时出现了AttributeError,这表明可能是因为环境中加载的qwen模块版本不包含该方法,或者存在其他阻止正确加载模块的问题。

为了解决这个问题,请确保您的环境中安装了正确版本的qwen模块,并且包含了can_embedding()方法。检查Python路径设置和模块的部署状态,确保没有旧版本的模块干扰当前环境。

如果问题仍然存在,您可能需要检查模块的导入方式和环境配置,确保在尝试访问can_embedding()方法时,环境能够正确识别和加载预期的qwen模块版本。

#### Details **Sources** - [server/model_workers/qwen.py](https://github.com/chatchat-space/Langchain-Chatchat/blob/master/server/model_workers/qwen.py) - [tests/test_online_api.py](https://github.com/chatchat-space/Langchain-Chatchat/blob/master/tests/test_online_api.py) - [server/agent/tools/search_knowledgebase_once.py](https://github.com/chatchat-space/Langchain-Chatchat/blob/master/server/agent/tools/search_knowledgebase_once.py) - [server/agent/tools/search_knowledgebase_complex.py](https://github.com/chatchat-space/Langchain-Chatchat/blob/master/server/agent/tools/search_knowledgebase_complex.py) - [configs/model_config.py.example](https://github.com/chatchat-space/Langchain-Chatchat/blob/master/configs/model_config.py.example) - [Dockerfile](https://github.com/chatchat-space/Langchain-Chatchat/blob/master/Dockerfile) - [markdown_docs/server/model_workers/qwen.md](https://github.com/chatchat-space/Langchain-Chatchat/blob/master/markdown_docs/server/model_workers/qwen.md) - [server/knowledge_base/kb_cache/base.py](https://github.com/chatchat-space/Langchain-Chatchat/blob/master/server/knowledge_base/kb_cache/base.py) - [server/embeddings_api.py](https://github.com/chatchat-space/Langchain-Chatchat/blob/master/server/embeddings_api.py)
**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.