From fe027300d0c06d8a3d54a84285fa67c424e09c9b Mon Sep 17 00:00:00 2001 From: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com> Date: Mon, 13 Oct 2025 16:06:59 +0200 Subject: [PATCH] Fix make precommit --- tests/conftest.py | 5 ++--- trl/extras/dataset_formatting.py | 12 ++++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index d22f3932cf..1fe37b1739 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -23,9 +23,8 @@ def cleanup_gpu(): """ Automatically cleanup GPU memory after each test. - This fixture helps prevent CUDA out of memory errors when running tests in parallel - with pytest-xdist by ensuring models and tensors are properly garbage collected - and GPU memory caches are cleared between tests. + This fixture helps prevent CUDA out of memory errors when running tests in parallel with pytest-xdist by ensuring + models and tensors are properly garbage collected and GPU memory caches are cleared between tests. """ yield # Cleanup after test diff --git a/trl/extras/dataset_formatting.py b/trl/extras/dataset_formatting.py index c4bf0e97f8..eaf17c341b 100644 --- a/trl/extras/dataset_formatting.py +++ b/trl/extras/dataset_formatting.py @@ -44,8 +44,8 @@ def conversations_formatting_function( tokenizer apply chat template to the dataset along with the schema of the list of functions in the tools list. .. deprecated:: 0.24.0 - `conversations_formatting_function` is deprecated and will be removed in version 0.27. - Please use `tokenizer.apply_chat_template()` directly instead. + `conversations_formatting_function` is deprecated and will be removed in version 0.27. Please use + `tokenizer.apply_chat_template()` directly instead. """ warnings.warn( "`conversations_formatting_function` is deprecated and will be removed in TRL 0.27. " @@ -74,8 +74,8 @@ def instructions_formatting_function(tokenizer: AutoTokenizer): tokenizer apply chat template to the dataset .. deprecated:: 0.24.0 - `instructions_formatting_function` is deprecated and will be removed in version 0.27. - Please use `tokenizer.apply_chat_template()` directly instead. + `instructions_formatting_function` is deprecated and will be removed in version 0.27. Please use + `tokenizer.apply_chat_template()` directly instead. """ warnings.warn( "`instructions_formatting_function` is deprecated and will be removed in TRL 0.27. " @@ -122,8 +122,8 @@ def get_formatting_func_from_dataset( Callable: Formatting function if the dataset format is supported else None .. deprecated:: 0.24.0 - `get_formatting_func_from_dataset` is deprecated and will be removed in version 0.27. - Please use `tokenizer.apply_chat_template()` directly instead. + `get_formatting_func_from_dataset` is deprecated and will be removed in version 0.27. Please use + `tokenizer.apply_chat_template()` directly instead. """ warnings.warn( "`get_formatting_func_from_dataset` is deprecated and will be removed in TRL 0.27. "