Skip to content

Commit

Permalink
removed redundant codes that pooch can handle automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
mese79 committed Jun 4, 2024
1 parent 65deee0 commit 75bcc3f
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/featureforest/utils/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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,
Expand Down

0 comments on commit 75bcc3f

Please sign in to comment.