From a79dc1edb6d45ee953564b92f37175a0994bc070 Mon Sep 17 00:00:00 2001 From: albert bou Date: Mon, 27 May 2024 11:56:17 +0200 Subject: [PATCH] extract fix --- acegen/models/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acegen/models/__init__.py b/acegen/models/__init__.py index 1b4b3517..996357eb 100644 --- a/acegen/models/__init__.py +++ b/acegen/models/__init__.py @@ -33,7 +33,7 @@ def extract(path): if tar_path.exists(): logging.info("Extracting model checkpoint...") with tarfile.open(tar_path, "r:gz") as tar: - tar.extractall(path=path.parent) + tar.extractall(path=tar_path.parent) return path else: raise FileNotFoundError(f"File {path} not found.") @@ -42,8 +42,8 @@ def extract(path): # extracting big model files only if they are not already extracted -if not Path("gpt2_enamine_real.ckpt").exists(): - extract(resources.files("acegen.priors") / "gpt2_enamine_real.ckpt.tar.gz") +if not (resources.files("acegen.priors") / "gpt2_enamine_real.ckpt").exists(): + extract(resources.files("acegen.priors") / "gpt2_enamine_real.ckpt") models = {