[generate] remove cache v4.47 deprecations (#36212)

This commit is contained in:
Joao Gante
2025-02-17 13:55:03 +00:00
committed by GitHub
parent 936aeb70ab
commit dad513e0c2
4 changed files with 18 additions and 28 deletions

View File

@@ -22,6 +22,7 @@ from parameterized import parameterized
from transformers import PhimoeConfig, StaticCache, is_torch_available, set_seed
from transformers.testing_utils import (
is_flaky,
require_torch,
slow,
torch_device,
@@ -449,6 +450,7 @@ class PhimoeModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMix
self.assertFalse(torch.allclose(original_long_output, scaled_long_output, atol=1e-5))
@parameterized.expand([("longrope",)])
@is_flaky() # TODO (joao): unify rope tests in the mixin
def test_model_rope_scaling_short_long_factor(self, scaling_type):
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
n_factors = config.hidden_size // config.num_key_value_heads // 2

View File

@@ -27,6 +27,7 @@ from transformers import (
is_vision_available,
)
from transformers.testing_utils import (
is_flaky,
require_flash_attn,
require_torch,
require_torch_gpu,
@@ -347,6 +348,10 @@ class Qwen2_5_VLModelTest(ModelTesterMixin, GenerationTesterMixin, unittest.Test
def test_generate_compile_fullgraph(self):
pass
@is_flaky() # TODO (joao/raushan): Investigate why this test is flaky on this model
def test_prompt_lookup_decoding_matches_greedy_search(self):
super().test_prompt_lookup_decoding_matches_greedy_search()
@require_torch
class Qwen2_5_VLIntegrationTest(unittest.TestCase):