Browse Source

feat: optimize weaviate batch size (#348)

tags/0.3.3
John Wang 2 years ago
parent
commit
6a3ab36101
No account linked to committer's email address
1 changed files with 13 additions and 1 deletions
  1. 13
    1
      api/core/vector_store/weaviate_vector_store_client.py

+ 13
- 1
api/core/vector_store/weaviate_vector_store_client.py View File

@@ -26,13 +26,25 @@ class WeaviateVectorStoreClient(BaseVectorStoreClient):

weaviate.connect.connection.has_grpc = grpc_enabled

return weaviate.Client(
client = weaviate.Client(
url=endpoint,
auth_client_secret=auth_config,
timeout_config=(5, 60),
startup_period=None
)

client.batch.configure(
# `batch_size` takes an `int` value to enable auto-batching
# (`None` is used for manual batching)
batch_size=100,
# dynamically update the `batch_size` based on import speed
dynamic=True,
# `timeout_retries` takes an `int` value to retry on time outs
timeout_retries=3,
)

return client

def get_index(self, service_context: ServiceContext, config: dict) -> GPTVectorStoreIndex:
index_struct = WeaviateIndexDict()


Loading…
Cancel
Save