Skip to content

Commit

Permalink
make embed private
Browse files Browse the repository at this point in the history
  • Loading branch information
Samoed committed Nov 5, 2024
1 parent a043d76 commit ebf31a4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(self, **kwargs: Any):
protected_namespaces=(),
)

def embed(
def _embed(
self, texts: list[str], encode_kwargs: Dict[str, Any]
) -> List[List[float]]:
"""
Expand Down Expand Up @@ -116,7 +116,7 @@ def embed_documents(self, texts: List[str]) -> List[List[float]]:
Returns:
List of embeddings, one for each text.
"""
return self.embed(texts, self.encode_kwargs)
return self._embed(texts, self.encode_kwargs)

def embed_query(self, text: str) -> List[float]:
"""Compute query embeddings using a HuggingFace transformer model.
Expand All @@ -132,4 +132,4 @@ def embed_query(self, text: str) -> List[float]:
if len(self.query_encode_kwargs) > 0
else self.encode_kwargs
)
return self.embed([text], embed_kwargs)[0]
return self._embed([text], embed_kwargs)[0]

0 comments on commit ebf31a4

Please sign in to comment.