Description
Server Setup Information
- Weaviate Server Version: 1.21.2
- Deployment Method: docker
- Multi Node? Number of Running Nodes:
- Client Language and Version:
- Multitenancy?:
Any additional Information
Running into " An error occurred: The ‘objects’ creation was cancelled because it took longer than the configured timeout of 60s. Try reducing the batch size (currently 1) to a lower value. Aim to on average complete batch request within less than 10s " when trying to import data with batch size one using following snippet
@staticmethod
def import_data_to_weaviate(client, vectorDB, properties, emb1, emb2, embedding_to_insert):
"""
Imports data into Weaviate by adding objects with embeddings.
"""
client.batch.configure(batch_size=1) # Configure batch
with client.batch as batch:
try:
# Generate a unique identifier based on the embeddings
uuid = weaviate.util.generate_uuid5(emb1.tobytes() + emb2.tobytes())
batch.add_data_object(properties, vectorDB, uuid=uuid, vector=np.array(embedding_to_insert))
except Exception as e:
print(f"An error occurred: {e}")
The error seems to occur randomly at times.