diff --git a/libs/community/langchain_community/embeddings/model2vec.py b/libs/community/langchain_community/embeddings/model2vec.py index 8cba54b09011a..223f611b0ed01 100644 --- a/libs/community/langchain_community/embeddings/model2vec.py +++ b/libs/community/langchain_community/embeddings/model2vec.py @@ -6,7 +6,7 @@ class Model2vecEmbeddings(Embeddings): - """model2v embedding models. + """Model2Vec embedding models. Install model2vec first, run 'pip install -U model2vec'. The github repository for model2vec is : https://github.com/MinishLab/model2vec @@ -51,7 +51,7 @@ def embed_documents(self, texts: List[str]) -> List[List[float]]: List of embeddings, one for each text. """ - return self._model.encode_as_sequence(texts) + return self._model.encode(texts).tolist() def embed_query(self, text: str) -> List[float]: """Embed a query using the model2vec embeddings model. @@ -63,4 +63,4 @@ def embed_query(self, text: str) -> List[float]: Embeddings for the text. """ - return self._model.encode(text) + return self._model.encode(text).tolist()