Skip to content

Commit

Permalink
chore: poetry.lock
Browse files Browse the repository at this point in the history
Signed-off-by: Anush008 <[email protected]>
  • Loading branch information
Anush008 committed Dec 11, 2024
1 parent c8a555a commit 396ed4e
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 40 deletions.
106 changes: 74 additions & 32 deletions embedchain/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion embedchain/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ langchain-cohere = "^0.3.0"
langchain-community = "^0.3.1"
langchain-aws = {version = "^0.2.1", optional = true}
langsmith = "^0.1.17"
fastembed = { version = "^0.3.6", optional = true, python = ">=3.9,<3.13" }
fastembed = { version = "^0.4.2", optional = true, python = "<3.13,>=3.8.0" }

[tool.poetry.group.dev.dependencies]
black = "^23.3.0"
Expand Down
14 changes: 7 additions & 7 deletions mem0/embeddings/fastembed.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from typing import Optional

from mem0.configs.embeddings.base import BaseEmbedderConfig
from mem0.embeddings.base import EmbeddingBase

try:
Expand All @@ -14,13 +17,10 @@ class FastEmbedEmbedding(EmbeddingBase):
Find the list of supported models at https://qdrant.github.io/fastembed/examples/Supported_Models/.
"""

def __init__(
self,
model="BAAI/bge-small-en-v1.5",
) -> None:
self.model = model
self.dims = 384
self._model = TextEmbedding(model_name=model)
def __init__(self, config: Optional[BaseEmbedderConfig] = None):
super().__init__(config)

self._model = TextEmbedding(model_name=self.config.model, **self.config.model_kwargs)

def embed(self, text):
return next(self._model.embed(text)).tolist()

0 comments on commit 396ed4e

Please sign in to comment.