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
9 changes: 4 additions & 5 deletions src/transformers/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ def parse_int_from_env(key, default=None):
_run_staging = parse_flag_from_env("HUGGINGFACE_CO_STAGING", default=False)
_run_pipeline_tests = parse_flag_from_env("RUN_PIPELINE_TESTS", default=True)
_run_agent_tests = parse_flag_from_env("RUN_AGENT_TESTS", default=False)
_run_third_party_device_tests = parse_flag_from_env("RUN_THIRD_PARTY_DEVICE_TESTS", default=False)


def is_staging_test(test_case):
Expand Down Expand Up @@ -959,13 +958,13 @@ def require_torch_multi_hpu(test_case):
) from e
elif torch.cuda.is_available():
torch_device = "cuda"
elif _run_third_party_device_tests and is_torch_npu_available():
elif is_torch_npu_available():
torch_device = "npu"
elif _run_third_party_device_tests and is_torch_mlu_available():
elif is_torch_mlu_available():
torch_device = "mlu"
elif _run_third_party_device_tests and is_torch_hpu_available():
elif is_torch_hpu_available():
torch_device = "hpu"
elif _run_third_party_device_tests and is_torch_xpu_available():
elif is_torch_xpu_available():
torch_device = "xpu"
else:
torch_device = "cpu"
Expand Down