File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
nemo_automodel/_transformers Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -734,7 +734,7 @@ def from_pretrained(
734734 share_encoder : bool = True ,
735735 pooling : str = "avg" ,
736736 l2_normalize : bool = True ,
737- attn_implementation : Optional [ str ] = None ,
737+ attn_implementation : str = DEFAULT_ATTN_IMPLEMENTATION ,
738738 use_liger_kernel : bool = True ,
739739 use_sdpa_patching : bool = True ,
740740 sdpa_method : Optional [List [SDPBackend ]] = None ,
@@ -762,7 +762,8 @@ def from_pretrained(
762762 l2_normalize: Whether to L2 normalize embeddings.
763763 attn_implementation: Attention implementation to use (e.g.,
764764 ``"flash_attention_2"``, ``"sdpa"``, ``"eager"``).
765- Defaults to ``None`` (uses the model/transformers default, typically sdpa).
765+ Defaults to ``DEFAULT_ATTN_IMPLEMENTATION``
766+ (``"flash_attention_2"`` when flash-attn is installed, otherwise ``"sdpa"``).
766767 use_liger_kernel: Whether to apply Liger kernel optimizations.
767768 use_sdpa_patching: Whether to apply SDPA patching.
768769 sdpa_method: SDPA backend methods to use.
You can’t perform that action at this time.
0 commit comments