Skip to content

Commit

Permalink
Fix saving large pipelines (#1335)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Geekman authored Jul 31, 2023
1 parent e4c121c commit cceb500
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `mrmr` feature selection working with categoricals ([#1311](https://github.com/tinkoff-ai/etna/pull/1311))
- Fix version of `statsforecast` to 1.4 to avoid dependency conflicts during installation ([#1313](https://github.com/tinkoff-ai/etna/pull/1313))
- Add inverse transformation into `predict` method of pipelines ([#1314](https://github.com/tinkoff-ai/etna/pull/1314))
- Allow saving large pipelines ([#1335](https://github.com/tinkoff-ai/etna/pull/1335))

### Removed
- Building docker images with cuda 10.2 ([#1306](https://github.com/tinkoff-ai/etna/pull/1306))
Expand Down
2 changes: 1 addition & 1 deletion etna/core/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def _save_metadata(self, archive: zipfile.ZipFile):
output_file.write(metadata_bytes)

def _save_state(self, archive: zipfile.ZipFile):
with archive.open("object.pkl", "w") as output_file:
with archive.open("object.pkl", "w", force_zip64=True) as output_file:
dill.dump(self, output_file)

def save(self, path: pathlib.Path):
Expand Down
4 changes: 2 additions & 2 deletions etna/models/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ def get_model(self) -> Any:


class SaveNNMixin(SaveMixin):
"""Implementation of ``AbstractSaveable`` torch related classes.
"""Implementation of ``AbstractSaveable`` torch related classes.
It saves object to the zip archive with 2 files:
Expand All @@ -642,7 +642,7 @@ class SaveNNMixin(SaveMixin):
def _save_state(self, archive: zipfile.ZipFile):
import torch

with archive.open("object.pt", "w") as output_file:
with archive.open("object.pt", "w", force_zip64=True) as output_file:
torch.save(self, output_file, pickle_module=dill)

@classmethod
Expand Down

1 comment on commit cceb500

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.