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