Skip to content

Commit e0e7504

Browse files
committed
Revert "fix security issue with allow all kernels"
This reverts commit 7904f30.
1 parent 7904f30 commit e0e7504

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/transformers/modeling_utils.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,6 +1911,11 @@ def _check_and_adjust_attn_implementation(
19111911
"""
19121912
is_paged, base_implementation = split_attention_implementation(attn_implementation)
19131913

1914+
# A kernel the model explicitly lists in `_compatible_flash_implementations` is vouched for by
1915+
# the model author, so authorize loading it even when it lives outside the `kernels-community` org.
1916+
if base_implementation in (getattr(self, "_compatible_flash_implementations", None) or []):
1917+
allow_all_kernels = True
1918+
19141919
# Auto-correct model's default flash implementation if specified
19151920
if attn_implementation is not None:
19161921
compatible_flash_implementations = getattr(self, "_compatible_flash_implementations", None)

0 commit comments

Comments
 (0)