Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
sync with cht-llama-cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl authored Nov 3, 2023
1 parent 0f310d6 commit a8e4707
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ebd-all-minilm/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ def embeddings(cls, texts):
return values.tolist()

@classmethod
def get_model(cls, model=None):
def get_model(cls, model_path):
if cls.model is None:
if model is None or not os.path.exists(model):
model = os.getenv("MODEL_ID", "all-MiniLM-L6-v2")
cls.model = SentenceTransformer(
model,
model_path,
device=os.getenv("DEVICE", "cpu"),
)
return cls.model

0 comments on commit a8e4707

Please sign in to comment.