Skip to content

Commit

Permalink
Fix bug where SetFitHead not moved to non-cuda devices on init (#518)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Aarsen <[email protected]>
  • Loading branch information
ajmssc and tomaarsen authored Sep 18, 2024
1 parent 6d4010d commit 6c8d739
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/setfit/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(
self.temperature = temperature
self.eps = eps
self.bias = bias
self._device = device or "cuda" if torch.cuda.is_available() else "cpu"
self._device = device or ("cuda" if torch.cuda.is_available() else "cpu")
self.multitarget = multitarget

self.to(self._device)
Expand Down

0 comments on commit 6c8d739

Please sign in to comment.