Skip to content

Commit

Permalink
Update test_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrilvallez committed Oct 9, 2024
1 parent c83c9a8 commit afbb69a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/generation/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2036,6 +2036,8 @@ def test_generate_with_dynamic_sliding_window_cache(self, left_padding: bool):
config, _ = self.prepare_config_and_inputs_for_generate()
if getattr(config, "sliding_window", None) is None:
self.skipTest(reason="This model does not support sliding window.")
if "qwen2" in str(model_class).lower():
self.skipTest(reason="Sliding window attention is not implemented for sdpa in Qwen2 models.")

input_ids = ids_tensor((2, 7), vocab_size=config.vocab_size)
if left_padding:
Expand Down Expand Up @@ -2084,6 +2086,8 @@ def test_generate_continue_from_dynamic_sliding_window_cache(self, sliding_windo
config, _ = self.prepare_config_and_inputs_for_generate()
if getattr(config, "sliding_window", None) is None:
self.skipTest(reason="This model does not support sliding window.")
if "qwen2" in str(model_class).lower():
self.skipTest(reason="Sliding window attention is not implemented for sdpa in Qwen2 models.")

# We need to be sure to always have shape (2, 7) for the different test assumptions to hold
input_ids = ids_tensor((2, 7), vocab_size=config.vocab_size)
Expand Down

0 comments on commit afbb69a

Please sign in to comment.