diff --git a/.gitignore b/.gitignore index 88f2fae8..eeb06992 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,6 @@ dist settings.toml *.pkl -.idea/ \ No newline at end of file +.idea/ +src/llm_vm/profile.html +src/llm_vm/profile.json diff --git a/pyproject.toml b/pyproject.toml index 537e9b78..362b05d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,6 +34,7 @@ dependencies = [ "trl>=0.7.2", "pinecone-client>=2.2.4", "PyPDF2>=3.0.1", + "scalene>=1.5.31.1", "weaviate-client>=3.25.3", "python-dotenv>=1.0.0" ] diff --git a/src/llm_vm/vector_db.py b/src/llm_vm/vector_db.py index 1e2ff0d9..2eafd64e 100644 --- a/src/llm_vm/vector_db.py +++ b/src/llm_vm/vector_db.py @@ -1,9 +1,13 @@ from abc import ABC,abstractmethod import pinecone + import weaviate from dotenv import load_dotenv import os +from scalene import profile + + load_dotenv("../../.env.example") class VectorDB(ABC): @@ -32,7 +36,7 @@ def upsert(self, **kwargs): def query(self, **kwargs): pass - +@profile class PineconeDB(VectorDB): def __init__(self, api_key, pinecone_env): self.pinecone = pinecone