Skip to content

Commit

Permalink
function to get embeddings size
Browse files Browse the repository at this point in the history
  • Loading branch information
generall committed Jan 23, 2025
1 parent 01894a8 commit b72dd26
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions qdrant_client/qdrant_fastembed.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,23 @@ def _validate_collection_info(self, collection_info: models.CollectionInfo) -> N
modifier == models.Modifier.IDF
), f"{self.sparse_embedding_model_name} requires modifier IDF, current modifier is {modifier}"

def get_embedding_size(
self,
model_name: Optional[str] = None,
) -> int:
"""
Get the size of the embeddings produced by the specified model.
Args:
model_name: optional, the name of the model to get the embedding size for. If None, the default model will be used.
Returns:
int: the size of the embeddings produced by the model.
"""
model_name = model_name or self.embedding_model_name
embeddings_size, _ = self._get_model_params(model_name=model_name)
return embeddings_size

def get_fastembed_vector_params(
self,
on_disk: Optional[bool] = None,
Expand Down

0 comments on commit b72dd26

Please sign in to comment.