fix comment and match old behaviour
This commit is contained in:
parent
6d443b91b5
commit
c4f01056ae
2 changed files with 5 additions and 4 deletions
|
|
@ -250,7 +250,7 @@ def determine_attention_implementation(model_class, config):
|
|||
and (model_class is not None)
|
||||
and getattr(model_class, "_supports_flex_attn", False)
|
||||
):
|
||||
# GPT-OSS, Mllama and Gemma3 use eager/sdpa attention during
|
||||
# GPT-OSS, Mllama and Gemma3N use eager/sdpa attention during
|
||||
# inference since flex attention returns incorrect results or errors out.
|
||||
# GPT-OSS: left padding issues cause incorrect outputs.
|
||||
# Mllama: _update_causal_mask uses make_flex_block_causal_mask which
|
||||
|
|
|
|||
|
|
@ -623,9 +623,10 @@ class FastBaseModel:
|
|||
if not ("attn_implementation" in kwargs):
|
||||
kwargs["attn_implementation"] = attn_impl
|
||||
if not supports_sdpa and kwargs.get("attn_implementation") == "sdpa":
|
||||
print(
|
||||
f"Unsloth: {model_type_arch.title()} does not support SDPA - switching to fast eager."
|
||||
)
|
||||
if os.environ.get("UNSLOTH_ENABLE_FLEX_ATTENTION", "1") == "0":
|
||||
print(
|
||||
f"Unsloth: {model_type_arch.title()} does not support SDPA - switching to fast eager."
|
||||
)
|
||||
del kwargs["attn_implementation"]
|
||||
|
||||
bnb_config = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue