You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"name 'bias' is not defined" in kernels\utils.py get_lora_parameters_bias #1893
def get_lora_parameters_bias(proj):
# For DPO or disabled adapters
base_layer = getattr(proj, "base_layer", proj) # (proj.base_layer if hasattr(proj, "base_layer") else proj)
W = base_layer.weight
# if not hasattr(proj, "disable_adapters") or proj.disable_adapters or proj.merged:
if getattr(proj, "disable_adapters", True) or proj.merged:
return W, getattr(W, "quant_state", None), None, None, None, bias
pass
adapter = getattr(proj, "active_adapters", None)
if adapter is None: adapter = getattr(proj, "active_adapter", ("default"))
adapter = adapter[0]
return (
W,
getattr(W, "quant_state", None),
proj.lora_A [adapter].weight,
proj.lora_B [adapter].weight,
proj.scaling[adapter],
base_layer.bias,
)
And, well, bias is, indeed, not defined in the first return. Replacing it with base_layer.bias seems to do the trick (at least it no longer crashes), but not sure if its what supposed to be there.
Just fixed - apologies! For Colab, Kaggle, please restart and run all again. For local machines, do: pip install --force-reinstall --no-deps --no-cache-dir unsloth unsloth_zoo
Activity
Xisikka commentedon Mar 4, 2025
having same issues here,this was not an issue one day ago.
danielhanchen commentedon Mar 4, 2025
Just fixed - apologies! For Colab, Kaggle, please restart and run all again. For local machines, do:
pip install --force-reinstall --no-deps --no-cache-dir unsloth unsloth_zooxandrmoro commentedon Mar 4, 2025
Yup, works now, thanks!
feat(studio): MLX PLE and expert offload in Unsloth Studio (unslothai…