From b44ea88d0187dd5381cb25de5d4897270f6ab247 Mon Sep 17 00:00:00 2001 From: Emre Date: Tue, 12 Nov 2024 11:36:51 -0800 Subject: [PATCH] Use MODEL env var --- app/src/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/tasks.py b/app/src/tasks.py index bd6b610..8d104ad 100644 --- a/app/src/tasks.py +++ b/app/src/tasks.py @@ -3,6 +3,7 @@ """ from typing import Any +import os from celery import Task from loguru import logger @@ -27,7 +28,7 @@ def __call__(self, *args, **kwargs) -> Any: if not self.model: # Protecting this in the __call__ method to avoid # loading the model in the fastapi server process. - self.model = NERModel() + self.model = NERModel(os.getenv("MODEL")) return self.run(*args, **kwargs)