Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
akiFQC committed Aug 9, 2024
1 parent 39f98a3 commit abe4f88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/jmteb/evaluators/reranking/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def _compute_metrics(

with tqdm.tqdm(total=len(query_dataset), desc="Reranking docs") as pbar:
if torch.cuda.is_available():
if dist.is_available():
if dist.is_available() and dist.is_torchelastic_launched():
device = f"cuda:{dist.get_rank()}"
else:
device = "cuda"
Expand Down
2 changes: 1 addition & 1 deletion src/jmteb/evaluators/retrieval/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _compute_metrics(
doc_embeddings_chunk = doc_embeddings[offset : offset + self.doc_chunk_size]

if torch.cuda.is_available():
if dist.is_available():
if dist.is_available() and dist.is_torchelastic_launched():
device = f"cuda:{dist.get_rank()}"
else:
device = "cuda"
Expand Down

0 comments on commit abe4f88

Please sign in to comment.