diff --git a/combo/modules/model.py b/combo/modules/model.py index 223bacc2ce07ad77e57876a8be367d46b92c9b58..76e83be87dd3e38559319df44d26e45b757c8ff7 100644 --- a/combo/modules/model.py +++ b/combo/modules/model.py @@ -447,21 +447,13 @@ class Model(Module, pl.LightningModule, FromParameters): vocabulary and the trained weights. """ if config is None: - try: - with open(os.path.join(serialization_dir, 'config.json'), 'r') as f: - config = json.load(f) - except FileNotFoundError: - with open(os.path.join(serialization_dir, 'model/config.json'), 'r') as f: - config = json.load(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: config = json.load(f) weights_file = weights_file or os.path.join(serialization_dir, 'weights.th') - if not os.path.exists(weights_file): - weights_file = os.path.join(serialization_dir, 'model/weights.th') - if not os.path.exists(weights_file): - raise ConfigurationError("weights.th not in " + serialization_dir + " or " + serialization_dir + "/model") # Peak at the class of the model. model_type = (