mirror of
https://github.com/saymrwulf/transformers.git
synced 2026-05-14 20:58:08 +00:00
be permissive
This commit is contained in:
parent
584b443096
commit
95cb944ee6
1 changed files with 4 additions and 1 deletions
|
|
@ -1493,7 +1493,10 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
|
|||
message += (
|
||||
', `"attn_implementation=flex_attention"` (implementation using torch\'s flex_attention)'
|
||||
)
|
||||
raise ValueError(message + ".")
|
||||
if config._attn_implementation in ALL_ATTENTION_FUNCTIONS:
|
||||
pass
|
||||
else:
|
||||
raise ValueError(message + ".")
|
||||
|
||||
# If a config is passed with a preset attn_implementation, we skip the automatic dispatch and use the user-provided config, with hard checks that the requested attention implementation is available.
|
||||
requested_attn_implementation = config._attn_implementation_internal
|
||||
|
|
|
|||
Loading…
Reference in a new issue