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

Python Profiler #352

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ dist
settings.toml
*.pkl

.idea/
.idea/
src/llm_vm/profile.html
src/llm_vm/profile.json
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Expand Down
6 changes: 5 additions & 1 deletion src/llm_vm/vector_db.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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
Expand Down