[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