Skip to content

Commit

Permalink
Fix Metaphor Annotation for use without GPU.
Browse files Browse the repository at this point in the history
  • Loading branch information
fschncvg committed Oct 26, 2024
1 parent db32bf5 commit fdec8b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = freestylo
version = 0.2.0
version = 0.3.0
description = A tool for stylistic device detection."
author = Felix Schneider
author_email = [email protected]
Expand Down
2 changes: 1 addition & 1 deletion src/freestylo/MetaphorAnnotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def serialize(self) -> list:
def load_model(self, model_path):
model_path = get_model_path(model_path)
self.model = SimilarityNN.SimilarityNN(300, 128, 1, 128, self.device)
self.model.load_state_dict(torch.load(model_path, weights_only=True))
self.model.load_state_dict(torch.load(model_path, weights_only=True, map_location=self.device))
self.model = self.model.to(self.device)
self.model.eval()

Expand Down

0 comments on commit fdec8b3

Please sign in to comment.