diff --git a/image_prediction/pipeline.py b/image_prediction/pipeline.py index 704a88f..2bff17a 100644 --- a/image_prediction/pipeline.py +++ b/image_prediction/pipeline.py @@ -1,7 +1,6 @@ import os -from functools import partial +from functools import lru_cache, partial from itertools import chain, tee -from typing import Iterable from funcy import rcompose, first, compose, second, chunks, identity, rpartial from tqdm import tqdm @@ -20,6 +19,7 @@ from image_prediction.utils.generic import lift, starlift os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" +@lru_cache(maxsize=None) def load_pipeline(**kwargs): model_loader = get_mlflow_model_loader(MLRUNS_DIR) model_identifier = CONFIG.service.mlflow_run_id @@ -38,7 +38,7 @@ def star(f): class Pipeline: - def __init__(self, model_loader, model_identifier, batch_size=16, verbose=True, **kwargs): + def __init__(self, model_loader, model_identifier, batch_size=16, verbose=False, **kwargs): self.verbose = verbose extract = get_extractor(**kwargs)