Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions deepeval/scorer/scorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,12 @@ def bert_score(
except ModuleNotFoundError as e:
print("Please install torch module. Command: pip install torch")

# FIXME: Fix the case for mps
device = "cuda" if torch.cuda.is_available() else "cpu"
if torch.cuda.is_available():
device = "cuda"
elif torch.backends.mps.is_available():
device = "mps"
else:
device = "cpu"
bert_scorer = BERTScorer(
model_type=model,
lang=lang,
Expand Down
Loading