Skip to content

Commit

Permalink
extract fix
Browse files Browse the repository at this point in the history
  • Loading branch information
albertbou92 committed May 27, 2024
1 parent befc5cc commit a79dc1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions acegen/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand All @@ -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 = {
Expand Down

0 comments on commit a79dc1e

Please sign in to comment.