Merge pull request #13342 from feddersen-group/feat/embedding_dim

feat: allow pgvector to use large embedding models
This commit is contained in:
Tim Jaeryang Baek 2025-04-30 02:41:26 -07:00 committed by GitHub
commit c9d3bb35c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -141,9 +141,8 @@ class PgvectorClient(VectorDBBase):
# Pad the vector with zeros # Pad the vector with zeros
vector += [0.0] * (VECTOR_LENGTH - current_length) vector += [0.0] * (VECTOR_LENGTH - current_length)
elif current_length > VECTOR_LENGTH: elif current_length > VECTOR_LENGTH:
raise Exception( # Truncate the vector to VECTOR_LENGTH
f"Vector length {current_length} not supported. Max length must be <= {VECTOR_LENGTH}" vector = vector[:VECTOR_LENGTH]
)
return vector return vector
def insert(self, collection_name: str, items: List[VectorItem]) -> None: def insert(self, collection_name: str, items: List[VectorItem]) -> None: