diff --git a/combo/modules/archival.py b/combo/modules/archival.py index 63a4cd831aa9f27ce6f4c31f6cee6f7f670552c8..496753f711f60fce9555d724fe72c7e49c7a8435 100644 --- a/combo/modules/archival.py +++ b/combo/modules/archival.py @@ -81,7 +81,7 @@ def archive(model: Model, with (TemporaryDirectory(os.path.join('tmp')) as t, BytesIO() as out_stream, tarfile.open(os.path.join(serialization_dir, 'model.tar.gz'), 'w|gz') as tar_file): - add_to_tar(tar_file, out_stream, json.dumps(parameters).encode(), 'config.template.json') + add_to_tar(tar_file, out_stream, json.dumps(parameters).encode(), 'config.json') weights_path = os.path.join(t, 'weights.th') torch.save(model.state_dict(), weights_path) tar_file.add(weights_path, 'weights.th') @@ -100,7 +100,7 @@ def extracted_archive(resolved_archive_file, cleanup=True): with tarfile.open(resolved_archive_file) as archive: subdir_and_files = [ tarinfo for tarinfo in archive.getmembers() - if (any([tarinfo.name.endswith(f) for f in ['config.template.json', 'weights.th']]) + if (any([tarinfo.name.endswith(f) for f in ['config.json', 'weights.th']]) or 'vocabulary' in tarinfo.name) ] for f in subdir_and_files: @@ -127,7 +127,7 @@ def load_archive(url_or_filename: Union[PathLike, str], with extracted_archive(rarchive_file) as archive_file: model = Model.load(archive_file, cuda_device=cuda_device) - config_path = os.path.join(archive_file, 'config.template.json') + config_path = os.path.join(archive_file, 'config.json') with open(config_path, 'r') as f: config = json.load(f) diff --git a/combo/modules/model.py b/combo/modules/model.py index 93b97407a7f1005920953da549b102cb396daac3..76e83be87dd3e38559319df44d26e45b757c8ff7 100644 --- a/combo/modules/model.py +++ b/combo/modules/model.py @@ -447,7 +447,7 @@ class Model(Module, pl.LightningModule, FromParameters): vocabulary and the trained weights. """ if config is None: - with open(os.path.join(serialization_dir, 'config.template.json'), 'r') as f: + with open(os.path.join(serialization_dir, 'config.json'), 'r') as f: config = json.load(f) elif isinstance(config, str) or isinstance(config, PathLike): with open(config, 'r') as f: diff --git a/setup.py b/setup.py index 05c199121c542f94117a9077f0a41fa8f49aead9..6943e298f499efc02da4d668feee52d029dfe439 100644 --- a/setup.py +++ b/setup.py @@ -27,8 +27,8 @@ REQUIREMENTS = [ ] setup( - name="combo", - version="3.0.0", + name="combo-nlp", + version="3.0.1", author="Maja Jablonska", author_email="maja.jablonska@ipipan.waw.pl", install_requires=REQUIREMENTS,