chat-ollama icon indicating copy to clipboard operation
chat-ollama copied to clipboard

[bug] 更新knowledge base出错

Open meokey opened this issue 10 months ago • 5 comments

··· Ollama: { host: 'http://192.168.0.100:11434', username: null, password: null } [Vue Router warn]: No match found for location with path "/api/knowledgebases/12" ···

但是12是我刚刚生成的knowledge base CTMS 2024-04-05 09_38_26-Arc

PS. 在chat里也可以查询这个知识库的内容。

meokey avatar Apr 05 '24 13:04 meokey

与 #201 一样的问题

satrong avatar Apr 05 '24 14:04 satrong

#201

meokey avatar Apr 05 '24 15:04 meokey

sorry I have to re-open the issue - I notice an PR has been merged and pulled the latest image, however it throws error message like below:

Update: There are 6 PDF files in ~2.5MBs. When I fed them in together, it gives the error, however, it works well in 3 batches, 2 files each. I have no idea why .......... 😕

Ollama:  { host: 'http://xxx.xxx.xxx.xxx:11434', username: null, password: null }
Knowledge base ID:  12
Ollama:  { host: 'http://xxx.xxx.xxx.xxx:11434', username: null, password: null }
Update knowledge base xxxxxxxxxxxxxxxxxxx with ID 12
Creating embeddings for OpenAI model: text-embedding-3-small, host: keys.x_openai_api_host
Creating Chroma vector store
Initializing ParentDocumentRetriever with RedisDocstore
Redis client options:  {
  host: 'xxx.xxx.xxx.xxx',
RangeError: Invalid string length
    at JSON.stringify (<anonymous>)
    at Object.upsert (file:///app/.output/server/node_modules/chromadb/dist/chromadb.mjs:724:44)
    at Object.upsert (file:///app/.output/server/node_modules/chromadb/dist/chromadb.mjs:1321:72)
    at ApiApi.upsert (file:///app/.output/server/node_modules/chromadb/dist/chromadb.mjs:1568:41)
    at Collection.upsert (file:///app/.output/server/node_modules/chromadb/dist/chromadb.mjs:1883:37)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Chroma.addVectors (file:///app/.output/server/node_modules/@langchain/community/dist/vectorstores/chroma.js:145:9)
    at async ParentDocumentRetriever.addDocuments (file:///app/.output/server/node_modules/langchain/dist/retrievers/parent_document.js:167:13)
[nuxt] [request error] [unhandled] [500] Invalid string length
  at JSON.stringify (<anonymous>)  
  at Object.upsert (./.output/server/node_modules/chromadb/dist/chromadb.mjs:724:44)  
  at Object.upsert (./.output/server/node_modules/chromadb/dist/chromadb.mjs:1321:72)  
  at ApiApi.upsert (./.output/server/node_modules/chromadb/dist/chromadb.mjs:1568:41)  
  at Collection.upsert (./.output/server/node_modules/chromadb/dist/chromadb.mjs:1883:37)  
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)  
  at async Chroma.addVectors (./.output/server/node_modules/@langchain/community/dist/vectorstores/chroma.js:145:9)  
  at async ParentDocumentRetriever.addDocuments (./.output/server/node_modules/langchain/dist/retrievers/parent_document.js:167:13)  
  at async ingestDocument (./.output/server/chunks/_/http.mjs:34:3)  
  at async Object.handler (./.output/server/chunks/routes/api/knowledgebases/_id_.put.mjs:72:5)

meokey avatar Apr 05 '24 18:04 meokey

Vue,http server ,还有embedding时对文件的切片的代码 对 upload 文件的大小和数量有限制吗? 如果有的话,最好在环境变量里可以自定义限制。

meokey avatar Apr 05 '24 22:04 meokey

根据我的测试,50个文件是没有问题的。关于大小,我还没有测试,我周末试试

sugarforever avatar Apr 05 '24 23:04 sugarforever