Gemma3 vs gemma3n issue resolve
This commit is contained in:
parent
e5a2d39d57
commit
c230eb525c
1 changed files with 2 additions and 2 deletions
|
|
@ -226,7 +226,7 @@ def determine_attention_implementation(model_class, config):
|
|||
model_type = getattr(config, "model_type", "").lower()
|
||||
|
||||
# 1. Flash Attention 2
|
||||
if HAS_FLASH_ATTENTION and model_type not in ("gpt_oss", "mllama") and not model_type.startswith("gemma3"):
|
||||
if HAS_FLASH_ATTENTION and model_type not in ("gpt_oss", "mllama") and not model_type.startswith("gemma3n"):
|
||||
supports_fa2 = False
|
||||
if model_class is not None:
|
||||
supports_fa2 = getattr(model_class, "_supports_flash_attn_2", False) or getattr(model_class, "_supports_flash_attn", False)
|
||||
|
|
@ -254,7 +254,7 @@ def determine_attention_implementation(model_class, config):
|
|||
# decode q_len=1, causing ValueError. Needs transformers update.
|
||||
# Gemma3N: timm vision wrappers (eg Gemma3nVisionConfig) do not
|
||||
# support flex_attention.
|
||||
if model_type not in ("gpt_oss", "mllama") and not model_type.startswith("gemma3"):
|
||||
if model_type not in ("gpt_oss", "mllama") and not model_type.startswith("gemma3n"):
|
||||
if config is not None:
|
||||
setattr(config, "_attn_implementation", "flex_attention")
|
||||
if hasattr(config, "attn_implementation"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue