From 85852fd902b41dfa1763558295f39baadd419e8c Mon Sep 17 00:00:00 2001 From: Dan Saunders Date: Wed, 10 Dec 2025 10:49:52 -0500 Subject: [PATCH] update TRL filter (#3707) * update TRL filter * both filters * Apply suggestion from @danielhanchen * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Daniel Han Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- unsloth/utils/packing.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/unsloth/utils/packing.py b/unsloth/utils/packing.py index a9d9d7ceca..5c13c55c7f 100644 --- a/unsloth/utils/packing.py +++ b/unsloth/utils/packing.py @@ -68,9 +68,14 @@ def _get_cached_block_mask( class _TrlPackingWarningFilter(logging.Filter): + to_filter = ( + "attention implementation is not", + "kernels-community", + ) + def filter(self, record: logging.LogRecord) -> bool: message = record.getMessage() - return not "kernels-community" in message + return not any(substring in message for substring in self.to_filter) _TRL_FILTER_INSTALLED = False