From 29d714cc5b7c886f51b24d3ed276d05ec1d9ebeb Mon Sep 17 00:00:00 2001 From: "d.a.bunin" Date: Thu, 27 Jul 2023 15:25:35 +0300 Subject: [PATCH 1/2] fix: fix saving large pipelines --- etna/core/mixins.py | 2 +- etna/models/mixins.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etna/core/mixins.py b/etna/core/mixins.py index 793675afb..dca2c2064 100644 --- a/etna/core/mixins.py +++ b/etna/core/mixins.py @@ -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): diff --git a/etna/models/mixins.py b/etna/models/mixins.py index baf999479..d42ce5985 100644 --- a/etna/models/mixins.py +++ b/etna/models/mixins.py @@ -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: @@ -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 From 3535dfc57744ff9723519d3d9976e980eca1c967 Mon Sep 17 00:00:00 2001 From: "d.a.bunin" Date: Thu, 27 Jul 2023 15:28:06 +0300 Subject: [PATCH 2/2] chore: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a82ca4a06..766ee2540 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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))