Skip to content

Commit

Permalink
[tests] make cuda-only tests device-agnostic (#35222)
Browse files Browse the repository at this point in the history
fix cuda-only tests
  • Loading branch information
faaany authored Dec 18, 2024
1 parent 1eee1ce commit c7e4805
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/models/rag/test_modeling_rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
require_sentencepiece,
require_tokenizers,
require_torch,
require_torch_non_multi_gpu,
require_torch_non_multi_accelerator,
slow,
torch_device,
)
Expand Down Expand Up @@ -678,7 +678,7 @@ def config_and_inputs(self):
@require_retrieval
@require_sentencepiece
@require_tokenizers
@require_torch_non_multi_gpu
@require_torch_non_multi_accelerator
class RagModelIntegrationTests(unittest.TestCase):
def tearDown(self):
super().tearDown()
Expand Down Expand Up @@ -1002,7 +1002,7 @@ def test_rag_token_generate_batch(self):
torch_device
)

if torch_device == "cuda":
if torch_device != "cpu":
rag_token.half()

input_dict = tokenizer(
Expand Down

0 comments on commit c7e4805

Please sign in to comment.