[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-05-16 15:47:54 +00:00
commit f16d0df146

View file

@ -1061,7 +1061,9 @@ class FastBaseModel:
if isinstance(_qcfg_dtype, str):
_qcfg_dtype_str = _qcfg_dtype.removeprefix("torch.")
_maybe_dtype = getattr(torch, _qcfg_dtype_str, None)
_qcfg_dtype = _maybe_dtype if isinstance(_maybe_dtype, torch.dtype) else None
_qcfg_dtype = (
_maybe_dtype if isinstance(_maybe_dtype, torch.dtype) else None
)
_effective_load_in_4bit = bool(load_in_4bit) or _qcfg_4bit
def _maybe_swap_gemma4_moe_4bit(_target_model):
@ -1099,7 +1101,8 @@ class FastBaseModel:
)
except Exception as _e:
_partial = sum(
1 for _m in _target_model.modules()
1
for _m in _target_model.modules()
if getattr(_m, "_unsloth_gemma4_moe_4bit_swapped", False)
)
if _partial: