-
Notifications
You must be signed in to change notification settings - Fork 5k
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
对数据库 提问有问题,找到数据但不回答或数据库没有的什么都不回答 #3288
Comments
嗨,@cstkn!很高兴再次见到你。希望你一切都好! 您的错误可能是由于在尝试测量一个为 在提供的上下文中,可能出现这个错误的地方有几处,但一个可能的情况是与处理文档及其内容的 context = "\n".join([doc.page_content for doc in docs]) 如果 另一个可能的错误源头可能是在处理 为解决这个问题,确保所有期望一个集合有长度的操作检查 例如,在连接 if docs is not None and len(docs) > 0:
context = "\n".join([doc.page_content for doc in docs])
else:
context = "" 这确保了 在Langchain-Chatchat代码库的 if len(docs) == 0: 这行假设 参考源码: 希望这些信息能帮助您解决问题。如果您有任何其他问题或需要进一步的澄清,请随时提问。 Sources
|
这个是大模型端有问题吧,你估计LLM对话也是不通的,检查大模型是否正常 |
我LLM对话是通的,但是还是遇到了这个问题是为什么呢 |
2024-03-12 18:34:25,072 - utils.py[line:38] - ERROR: object of type 'NoneType' has no len()
Traceback (most recent call last):
File "D:\wujiaping\chat\Langchain-Chatchat\server\utils.py", line 36, in wrap_done
await fn
File "D:\wujiaping\chat\Langchain-Chatchat.venv\Lib\site-packages\langchain\chains\base.py", line 385, in acall
raise e
File "D:\wujiaping\chat\Langchain-Chatchat.venv\Lib\site-packages\langchain\chains\base.py", line 379, in acall
await self._acall(inputs, run_manager=run_manager)
File "D:\wujiaping\chat\Langchain-Chatchat.venv\Lib\site-packages\langchain\chains\llm.py", line 275, in _acall
response = await self.agenerate([inputs], run_manager=run_manager)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\wujiaping\chat\Langchain-Chatchat.venv\Lib\site-packages\langchain\chains\llm.py", line 142, in agenerate
return await self.llm.agenerate_prompt(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\wujiaping\chat\Langchain-Chatchat.venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 554, in agenerate_prompt
return await self.agenerate(
^^^^^^^^^^^^^^^^^^^^^
File "D:\wujiaping\chat\Langchain-Chatchat.venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 514, in agenerate
raise exceptions[0]
File "D:\wujiaping\chat\Langchain-Chatchat.venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 617, in _agenerate_with_cache
return await self._agenerate(
^^^^^^^^^^^^^^^^^^^^^^
File "D:\wujiaping\chat\Langchain-Chatchat.venv\Lib\site-packages\langchain_community\chat_models\openai.py", line 522, in _agenerate
return await agenerate_from_stream(stream_iter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\wujiaping\chat\Langchain-Chatchat.venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 87, in agenerate_from_stream
async for chunk in stream:
File "D:\wujiaping\chat\Langchain-Chatchat.venv\Lib\site-packages\langchain_community\chat_models\openai.py", line 493, in _astream
if len(chunk["choices"]) == 0:
^^^^^^^^^^^^^^^^^^^^^
The text was updated successfully, but these errors were encountered: