From 75bcc3f19dcda71dea4c2526178f484b82e726d3 Mon Sep 17 00:00:00 2001 From: Mehdi Seifi Date: Tue, 4 Jun 2024 11:11:55 +0200 Subject: [PATCH] removed redundant codes that pooch can handle automatically --- src/featureforest/utils/downloader.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/featureforest/utils/downloader.py b/src/featureforest/utils/downloader.py index 747290b..6191743 100644 --- a/src/featureforest/utils/downloader.py +++ b/src/featureforest/utils/downloader.py @@ -2,13 +2,7 @@ import pooch -MODELS_CACHE_DIR = Path.home().joinpath(".featureforest").joinpath("models") -MODELS_CACHE_DIR.mkdir(parents=True, exist_ok=True) - - -def is_model_exists(model_name: str) -> bool: - model_file = MODELS_CACHE_DIR.joinpath(model_name) - return model_file.exists() +MODELS_CACHE_DIR = Path.home().joinpath(".featureforest", "models") def download_model( @@ -27,9 +21,6 @@ def download_model( Returns: str: full path of the downloaded file. """ - if is_model_exists(model_name): - return str(MODELS_CACHE_DIR.joinpath(model_name).absolute()) - try: downloaded_file = pooch.retrieve( url=model_url,