From 0c35280e58ea4a297c1a62f22523bc454301276b Mon Sep 17 00:00:00 2001 From: Benjamin Bossan Date: Fri, 27 Jun 2025 15:58:10 +0200 Subject: [PATCH] TST PEFT integration tests with pipeline generate (#39086) Some PEFT integration tests involving text generation pipelines were failing since #38129 because the base model is too small to generate longer sequences. Setting max_new_tokens fixes this. --- tests/peft_integration/test_peft_integration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/peft_integration/test_peft_integration.py b/tests/peft_integration/test_peft_integration.py index 56156334e2..523137d53a 100644 --- a/tests/peft_integration/test_peft_integration.py +++ b/tests/peft_integration/test_peft_integration.py @@ -531,7 +531,7 @@ class PeftIntegrationTester(unittest.TestCase, PeftTesterMixin): peft_params = list(peft_pipe.model.parameters()) base_params = list(base_pipe.model.parameters()) self.assertNotEqual(len(peft_params), len(base_params)) # Assert we actually loaded the adapter too - _ = peft_pipe("Hello") + _ = peft_pipe("Hello", max_new_tokens=20) def test_peft_add_adapter_with_state_dict(self): """ @@ -858,4 +858,4 @@ class PeftIntegrationTester(unittest.TestCase, PeftTesterMixin): ) # Generate text to verify pipeline works - _ = lora_generator(text) + _ = lora_generator(text, max_new_tokens=20)