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] search_knowledgebase_complex.py如何加载本地模型进行Rag?model_container.MODEL应该如何修改成自己的本地模型? #4072

Closed
a113ert222 opened this issue May 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@a113ert222
Copy link

a113ert222 commented May 23, 2024

2024-05-23 21:46:09,052 - utils.py[line:145] - INFO: Note: detected 96 virtual cores but NumExpr set to maximum of 64, check "NUMEXPR_MAX_THREADS" environment variable.
2024-05-23 21:46:09,052 - utils.py[line:148] - INFO: Note: NumExpr detected 96 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
2024-05-23 21:46:09,052 - utils.py[line:160] - INFO: NumExpr defaulting to 8 threads.
Traceback (most recent call last):
File "/home/user/Langchain-Chatchat/server/agent/tools/search_knowledgebase_complex.py", line 280, in
result = search_knowledgebase_complex("机器人和大数据在代码教学上有什么区别")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/Langchain-Chatchat/server/agent/tools/search_knowledgebase_complex.py", line 272, in search_knowledgebase_complex
llm_knowledge = LLMKnowledgeChain.from_llm(model, verbose=True, prompt=PROMPT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/Langchain-Chatchat/server/agent/tools/search_knowledgebase_complex.py", line 266, in from_llm
llm_chain = LLMChain(llm=llm, prompt=prompt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/miniconda3/envs/langchain-cc/lib/python3.11/site-packages/langchain_core/load/serializable.py", line 107, in init
super().init(**kwargs)
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 2 validation errors for LLMChain
llm
instance of Runnable expected (type=type_error.arbitrary_type; expected_arbitrary_type=Runnable)
llm
instance of Runnable expected (type=type_error.arbitrary_type; expected_arbitrary_type=Runnable)

这是search_knowledgebase_complex.py的报错信息,输入的model_container.MODEL不是一个Runnable的对象,要如何加载模型,变成BaseLanguageModel?

@a113ert222 a113ert222 added the bug Something isn't working label May 23, 2024
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