Skip to content

Commit 7904f30

Browse files
committed
fix security issue with allow all kernels
1 parent d77d573 commit 7904f30

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

‎src/transformers/modeling_utils.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,11 +1911,6 @@ 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-
19191914
# Auto-correct model's default flash implementation if specified
19201915
if attn_implementation is not None:
19211916
compatible_flash_implementations = getattr(self, "_compatible_flash_implementations", None)

0 commit comments

Comments
 (0)