Skip to content

Commit

Permalink
Use config options in model init
Browse files Browse the repository at this point in the history
  • Loading branch information
melihyilmaz authored Sep 22, 2023
1 parent 0d312e6 commit 0ea1b7d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions casanovo/denovo/model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,13 @@ def initialize_model(self, train: bool) -> None:
# otherwise use the provided configuration.
device = torch.empty(1).device # Use the default device.
try:
self.model = Spec2Pep.load_from_checkpoint(
self.model_filename,
map_location=device,
)
except RuntimeError:
self.model = Spec2Pep.load_from_checkpoint(
self.model_filename,
map_location=device,
**model_params,
)
except RuntimeError:
raise RuntimeError("Mismatching parameters between loaded model and config file")

def initialize_data_module(
self,
Expand Down

0 comments on commit 0ea1b7d

Please sign in to comment.