From ebf31a4d9e75647d93cfb9ec7bb5d6d2edd611e7 Mon Sep 17 00:00:00 2001 From: Roman Solomatin <36135455+Samoed@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:06:42 +0300 Subject: [PATCH] make embed private --- .../langchain_huggingface/embeddings/huggingface.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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]