From 7f5b7b368cb4d4c509ce8a88ce2d80eb2937cd9a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 08:24:17 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- unsloth/kernels/fp8.py | 5 ++--- unsloth/models/loader.py | 16 ++++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/unsloth/kernels/fp8.py b/unsloth/kernels/fp8.py index e3fd1b9cc4..044e5a9292 100644 --- a/unsloth/kernels/fp8.py +++ b/unsloth/kernels/fp8.py @@ -605,9 +605,8 @@ except: pass -HAS_FBGEMM_FP8_OPS = ( - hasattr(torch.ops, "fbgemm") - and hasattr(torch.ops.fbgemm, "quantize_fp8_per_row") +HAS_FBGEMM_FP8_OPS = hasattr(torch.ops, "fbgemm") and hasattr( + torch.ops.fbgemm, "quantize_fp8_per_row" ) diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index 43092bc71d..38811257ff 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -819,7 +819,9 @@ class FastLanguageModel(FastLlamaModel): if load_in_fp8 != False: _tag_model_with_fp8_torchao_config(model, fp8_mode) - if load_in_fp8 != False or _has_prequantized_fp8_config(model_name, token=token, trust_remote_code=trust_remote_code): + if load_in_fp8 != False or _has_prequantized_fp8_config( + model_name, token = token, trust_remote_code = trust_remote_code + ): maybe_patch_stacked_moe_expert_fp8_scales( model, model_name = model_name, @@ -1363,10 +1365,10 @@ class FastModel(FastBaseModel): model_name = get_model_name( model_name, load_in_4bit, - load_in_fp8=load_in_fp8, - fast_inference=fast_inference, - token=token, - trust_remote_code=trust_remote_code, + load_in_fp8 = load_in_fp8, + fast_inference = fast_inference, + token = token, + trust_remote_code = trust_remote_code, ) # Check if pre-quantized models are allowed # AMD Instinct GPUs need blocksize = 128 on bitsandbytes < 0.49.2 (our pre-quants use blocksize = 64) @@ -1576,7 +1578,9 @@ class FastModel(FastBaseModel): if load_in_fp8 != False: _tag_model_with_fp8_torchao_config(model, fp8_mode) - if load_in_fp8 != False or _has_prequantized_fp8_config(model_name, token=token, trust_remote_code=trust_remote_code): + if load_in_fp8 != False or _has_prequantized_fp8_config( + model_name, token = token, trust_remote_code = trust_remote_code + ): maybe_patch_stacked_moe_expert_fp8_scales( model, model_name = model_name,