Fix modular edge case + modular sorting order (#35562)

* look-ahead negation

* re add examples by default

* Fix the bug in topological sort

* Update create_dependency_mapping.py

* start adding test

* finalize test

* more tests

* style

* style
This commit is contained in:
Cyril Vallez
2025-01-09 17:17:52 +01:00
committed by GitHub
parent d3fe9fa3fe
commit 46276f9a7f
9 changed files with 98 additions and 57 deletions

View File

@@ -597,7 +597,7 @@ class DummyModel(DummyPreTrainedModel):
output_attentions: bool,
):
if self.config._attn_implementation == "flash_attention_2":
if attention_mask is not None and 0.0 in attention_mask:
if attention_mask is not None and (attention_mask == 0.0).any():
return attention_mask
return None