Skip to content

Commit

Permalink
update cuda.
Browse files Browse the repository at this point in the history
  • Loading branch information
shibing624 committed Jul 31, 2024
1 parent 32e5c46 commit 0a643f1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pytextclassifier/bert_classification_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,7 @@ def __init__(
" Make sure CUDA is available or set use_cuda=False."
)
else:
self.device = 'cuda' if torch.cuda.is_available() else (
'mps' if hasattr(torch.backends, "mps") and torch.backends.mps.is_available() else 'cpu')
self.device = 'mps' if hasattr(torch.backends, "mps") and torch.backends.mps.is_available() else 'cpu'
logger.debug(f"Device: {self.device}")

self.loss_fct = init_loss(
Expand Down

0 comments on commit 0a643f1

Please sign in to comment.