Skip to content

Commit

Permalink
updated model loading function to support zsbert model trained with o…
Browse files Browse the repository at this point in the history
…ld transformer library (4.21.3) (#61)

Signed-off-by: Marcos Martinez <[email protected]>
Co-authored-by: Alberto Purpura <[email protected]>
  • Loading branch information
marmg and Alberto Purpura authored Aug 24, 2023
1 parent ebaf046 commit f5fcf7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zshot/relation_extractor/zsrc/zero_shot_rel_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def load_model(device: Optional[Union[str, torch.device]] = None):
if not os.path.isfile(MODEL_PATH):
download_file(MODEL_REMOTE_URL, MODELS_CACHE_PATH)

model.load_state_dict(torch.load(MODEL_PATH))
model.load_state_dict(torch.load(MODEL_PATH), strict=False)
model.to(device)
model.eval()
return model
Expand Down

0 comments on commit f5fcf7f

Please sign in to comment.