mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 07:40:12 +01:00
Use chromadb max_batch_size public attribute
This commit is contained in:
parent
91163a247b
commit
0db5aebf2f
4 changed files with 138 additions and 319 deletions
|
|
@ -136,8 +136,7 @@ def batch_chromadb_insertions(chroma_client: API, documents: List[Document]) ->
|
|||
Split the total documents to be inserted into batches of documents that the local chroma client can process
|
||||
"""
|
||||
# Get max batch size.
|
||||
# Note: temp hack given max_batch_size is not yet exposed by ChromaDB API (WIP).
|
||||
max_batch_size = chroma_client._producer.max_batch_size
|
||||
max_batch_size = chroma_client.max_batch_size
|
||||
for i in range(0, len(documents), max_batch_size):
|
||||
yield documents[i:i + max_batch_size]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue