diff --git a/libs/partners/huggingface/langchain_huggingface/embeddings/huggingface.py b/libs/partners/huggingface/langchain_huggingface/embeddings/huggingface.py index 3eee5252c6de1..2bbc551f4e0b1 100644 --- a/libs/partners/huggingface/langchain_huggingface/embeddings/huggingface.py +++ b/libs/partners/huggingface/langchain_huggingface/embeddings/huggingface.py @@ -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]]: """ @@ -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. @@ -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]