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 <danielhanchen@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Dan Saunders 2025-12-10 10:49:52 -05:00 committed by GitHub
commit 2040946d68

View file

@ -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