From 53ab26cbb03b446c50f1f7912644dec7a3c95e44 Mon Sep 17 00:00:00 2001 From: Devin Gaffney Date: Wed, 9 Oct 2024 10:57:44 -0700 Subject: [PATCH 1/2] CV2-5050 tweak model name var --- lib/model/generic_transformer.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/model/generic_transformer.py b/lib/model/generic_transformer.py index 16430db..193365a 100644 --- a/lib/model/generic_transformer.py +++ b/lib/model/generic_transformer.py @@ -12,9 +12,10 @@ def __init__(self, model_name: str): Load specified model name from subclass constant as HuggingFace transformer. """ self.model = None - self.model_name = model_name - if model_name: - self.model = SentenceTransformer(model_name, cache_folder=os.getenv("MODEL_DIR", "./models")) + self.model_name = os.environ.get("MODEL_NAME") + self.internal_model_name = model_name + if self.internal_model_name: + self.model = SentenceTransformer(self.internal_model_name, cache_folder=os.getenv("MODEL_DIR", "./models")) def respond(self, docs: Union[List[schemas.Message], schemas.Message]) -> List[schemas.GenericItem]: """ From 1aed17309be979e6b7ff97f2663a601e96d80cb6 Mon Sep 17 00:00:00 2001 From: danielevalverde Date: Thu, 10 Oct 2024 08:40:06 -0300 Subject: [PATCH 2/2] create branch from epic/cv2-5050-text-vectorization-via-presto