You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
关于【构建向量索引数据库】示例的报错,提示:InvalidRequestError: This model's maximum context length is 4097 tokens, however you requested 23694 tokens (23438 in your prompt; 256 for the completion). Please reduce your prompt; or completion length.
#58
我是小白一枚,感谢提供的langchain的中文文档,帮助我入门学习。
我是按照文档的案例逐个进行本地测试的
当【构建向量索引数据库】时,按照文中提示的
然后再【构建本地知识库问答机器人】的示例代码的基础上进行修改的,以下为部分内容:
然后就报错了!!!
调试了好久,也没成功,后来仔细对比了一下【构建本地知识库问答机器人】示例,发现
docsearch = Chroma.from_documents(split_docs, embeddings)
传入的是split_docs,切割后的document,而不是原始的document.
修改后,
docsearch = Chroma.from_documents(documents, embeddings, persist_directory="/Users/ldx/Documents/data/chroma_data")
可以正常运行了。看来还是自己粗心,记录一下,万一也有人遇到呢。
The text was updated successfully, but these errors were encountered: