diff --git a/unsloth/kernels/flex_attention.py b/unsloth/kernels/flex_attention.py index 7a0ad25142..e1e0dc399b 100644 --- a/unsloth/kernels/flex_attention.py +++ b/unsloth/kernels/flex_attention.py @@ -42,8 +42,7 @@ def _flex_is_dgx_spark(): if not (hasattr(torch, "cuda") and torch.cuda.is_available()): return False names = " ".join( - str(torch.cuda.get_device_name(i)).upper() - for i in range(torch.cuda.device_count()) + str(torch.cuda.get_device_name(i)).upper() for i in range(torch.cuda.device_count()) ) return any(t in names for t in ("GB10", "JMJWOA", "N1X", "DGX SPARK", "GB110")) except Exception: diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 72fe785010..f21863c6b2 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -929,8 +929,7 @@ def is_dgx_spark(): if not (hasattr(torch, "cuda") and torch.cuda.is_available()): return False names = " ".join( - str(torch.cuda.get_device_name(i)).upper() - for i in range(torch.cuda.device_count()) + str(torch.cuda.get_device_name(i)).upper() for i in range(torch.cuda.device_count()) ) return any(token in names for token in _DGX_SPARK_DEVICE_TOKENS) except Exception: @@ -1041,7 +1040,6 @@ def patch_dgx_spark_dataloader_defaults(): return try: from transformers import training_args as _ta - Base = _ta.TrainingArguments except Exception: return