Skip to content

Commit

Permalink
Merge pull request #18 from grok-ai/develop
Browse files Browse the repository at this point in the history
Version 0.0.7
  • Loading branch information
lucmos authored Feb 22, 2022
2 parents 4baa63d + 64273d2 commit e4e0296
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ author = Valentino Maiorca
author_email = [email protected]
keywords = python, torch
license = MIT License
url = https://github.com/Flegyas/nn-template-core
url = https://github.com/grok-ai/nn-template-core

[options]
zip_safe = False
Expand Down
7 changes: 7 additions & 0 deletions src/nn_core/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ def compress_checkpoint(src_dir: Path, dst_file: Path, delete_dir: bool = True):
with zipfile.ZipFile(_normalize_path(dst_file), "w") as zip_file:
for folder, subfolders, files in os.walk(src_dir):
folder: Path = Path(folder)
for subfolder in subfolders:
zip_file.write(
folder / subfolder,
(folder / subfolder).relative_to(src_dir),
compress_type=zipfile.ZIP_DEFLATED,
)

for file in files:
zip_file.write(
folder / file,
Expand Down

0 comments on commit e4e0296

Please sign in to comment.