Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community: fixed bug in model2vec embedding code #28670

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libs/community/langchain_community/embeddings/model2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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()
Loading