Remove fastembed dependency

This commit is contained in:
Leon Luithlen 2024-11-04 17:02:47 +01:00
parent 79642cfca1
commit 115e93b791
5 changed files with 949 additions and 872 deletions

View file

@ -1,25 +0,0 @@
from typing import List, Optional
from fastembed import TextEmbedding
from cognee.root_dir import get_absolute_path
from cognee.infrastructure.databases.vector.embeddings.EmbeddingEngine import EmbeddingEngine
class FastembedEmbeddingEngine(EmbeddingEngine):
embedding_model: str
embedding_dimensions: int
def __init__(
self,
embedding_model: Optional[str] = "BAAI/bge-large-en-v1.5",
embedding_dimensions: Optional[int] = 1024,
):
self.embedding_model = embedding_model
self.embedding_dimensions = embedding_dimensions
async def embed_text(self, text: List[str]) -> List[float]:
embedding_model = TextEmbedding(model_name = self.embedding_model, cache_dir = get_absolute_path("cache/embeddings"))
embeddings_list = list(map(lambda embedding: embedding.tolist(), embedding_model.embed(text)))
return embeddings_list
def get_vector_size(self) -> int:
return self.embedding_dimensions

View file

@ -1,4 +1,3 @@
import dsp
import dspy import dspy
from dspy.evaluate.evaluate import Evaluate from dspy.evaluate.evaluate import Evaluate
from dspy.primitives.example import Example from dspy.primitives.example import Example

View file

@ -1,4 +1,3 @@
import dsp
import dspy import dspy
from dspy.teleprompt import BootstrapFewShot from dspy.teleprompt import BootstrapFewShot
from dspy.primitives.example import Example from dspy.primitives.example import Example

1757
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -24,48 +24,46 @@ pydantic = "2.8.2"
python-dotenv = "1.0.1" python-dotenv = "1.0.1"
fastapi = "^0.109.2" fastapi = "^0.109.2"
uvicorn = "0.22.0" uvicorn = "0.22.0"
requests = "2.32.3"
aiohttp = "3.10.10"
typing_extensions = "4.12.2"
dspy = "2.5.25"
nest_asyncio = "1.6.0"
numpy = "1.26.4"
datasets = "3.1.0"
falkordb = "1.0.9"
boto3 = "^1.26.125" boto3 = "^1.26.125"
botocore="^1.35.54"
gunicorn = "^20.1.0" gunicorn = "^20.1.0"
sqlalchemy = "2.0.35" sqlalchemy = "2.0.35"
instructor = "1.3.5" instructor = "1.6.3"
networkx = "^3.2.1" networkx = "^3.2.1"
debugpy = "1.8.2"
pyarrow = "15.0.0"
pylint = "^3.0.3"
aiosqlite = "^0.20.0" aiosqlite = "^0.20.0"
pandas = "2.0.3" pandas = "2.0.3"
greenlet = "^3.0.3"
ruff = "^0.2.2"
filetype = "^1.2.0" filetype = "^1.2.0"
nltk = "^3.8.1" nltk = "^3.8.1"
dlt = {extras = ["sqlalchemy"], version = "^1.2.0"} dlt = {extras = ["sqlalchemy"], version = "^1.2.0"}
overrides = "^7.7.0"
aiofiles = "^23.2.1" aiofiles = "^23.2.1"
qdrant-client = "^1.9.0" qdrant-client = "^1.9.0"
graphistry = "^0.33.5" graphistry = "^0.33.5"
tenacity = "^8.2.3" tenacity = "^9.0.0"
weaviate-client = "4.6.7" weaviate-client = "4.6.7"
scikit-learn = "^1.5.0" scikit-learn = "^1.5.0"
fastembed = "0.2.7"
pypdf = "^4.1.0" pypdf = "^4.1.0"
neo4j = "^5.20.0" neo4j = "^5.20.0"
jinja2 = "^3.1.3" jinja2 = "^3.1.3"
matplotlib = "^3.8.3" matplotlib = "^3.8.3"
structlog = "^24.1.0"
tiktoken = "0.7.0" tiktoken = "0.7.0"
langchain_text_splitters = "0.3.2"
langsmith = "0.1.139"
langdetect = "1.0.9"
posthog = "^3.5.0" posthog = "^3.5.0"
lancedb = "0.8.0" lancedb = "0.8.0"
litellm = "1.51.3" litellm = "1.49.1"
groq = "0.8.0" groq = "0.8.0"
tantivy = "^0.22.0"
tokenizers ="0.15.2"
transformers ="4.39.0"
python-multipart = "^0.0.9"
langfuse = "^2.32.0" langfuse = "^2.32.0"
protobuf = "<5.0.0"
pydantic-settings = "^2.2.1" pydantic-settings = "^2.2.1"
anthropic = "^0.26.1" anthropic = "^0.26.1"
pdfplumber = "^0.11.1"
sentry-sdk = {extras = ["fastapi"], version = "^2.9.0"} sentry-sdk = {extras = ["fastapi"], version = "^2.9.0"}
fastapi-users = { version = "*", extras = ["sqlalchemy"] } fastapi-users = { version = "*", extras = ["sqlalchemy"] }
asyncpg = "^0.29.0" asyncpg = "^0.29.0"
@ -88,6 +86,11 @@ pytest-asyncio = "^0.21.1"
coverage = "^7.3.2" coverage = "^7.3.2"
mypy = "^1.7.1" mypy = "^1.7.1"
notebook = "^7.1.1" notebook = "^7.1.1"
deptry = "^0.20.0"
debugpy = "1.8.2"
pylint = "^3.0.3"
ruff = "^0.2.2"
tweepy = "4.14.0"
[tool.poetry.group.docs.dependencies] [tool.poetry.group.docs.dependencies]
mkdocs-material = "^9.5.42" mkdocs-material = "^9.5.42"