Description
im trying to connect weaviate to my hugging face endpoint using hf api key :
def create_weaviate_client(huggingface_key, weaviate_url, weaviate_api_key):
headers = {"X-HuggingFace-Api-Key": huggingface_key}
client = weaviate.connect_to_weaviate_cloud(
cluster_url=weaviate_url,
auth_credentials=Auth.api_key(weaviate_api_key),
headers=headers
)
return client
# Import schema to Weaviate
def import_schema_to_weaviate(client, schema_data, model):
schema_name = schema_data["database_name"]+"hi1"
# Create the schema collection in Weaviate
client.collections.create(
name=schema_name,
vectorizer_config=wvc.config.Configure.Vectorizer.text2vec_huggingface(model=model),
vector_index_config=Configure.VectorIndex.hnsw(), # Use the HNSW index
properties=[
wvc.config.Property(name="content", data_type=wvc.config.DataType.TEXT),
wvc.config.Property(name="type", data_type=wvc.config.DataType.TEXT),
wvc.config.Property(name="entity", data_type=wvc.config.DataType.TEXT),
wvc.config.Property(name="description", data_type=wvc.config.DataType.TEXT)
]
)
print(f"Schema {schema_name} created successfully.")
the collelction is created successfully
but when i insert new object : for entry in schema_entries:
schema_collection.data.insert(properties=entry) , i get the following error : Error data insertion: Object was not added! Unexpected status code: 500, with response body: {‘error’: [{‘message’: ‘vectorize target vector : update vector: unmarshal error response body: Not Found’}]}.
Error data insertion: Object was not added! Unexpected status code: 500, with response body: {‘error’: [{‘message’: ‘vectorize target vector : update vector: unmarshal error response body: Not Found’}]}.