From 48db7e552dd2e4b389b2ab82331358bfa11d3a83 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 3 Sep 2025 20:12:42 -0700 Subject: [PATCH] Update import_fixes.py --- unsloth/import_fixes.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/unsloth/import_fixes.py b/unsloth/import_fixes.py index cc4f6dbfc7..b31b47e69b 100644 --- a/unsloth/import_fixes.py +++ b/unsloth/import_fixes.py @@ -17,8 +17,16 @@ import importlib.util from pathlib import Path from importlib.metadata import version as importlib_version from packaging.version import Version +import logging UNSLOTH_ENABLE_LOGGING = os.environ.get("UNSLOTH_ENABLE_LOGGING", "0") == "1" +# Ignore logging messages +class HideLoggingMessage(logging.Filter): + __slots__ = "text", + def __init__(self, text): self.text = text + def filter(self, x): return not (self.text in x.getMessage()) +pass + # Fix up AttributeError: 'MessageFactory' object has no attribute 'GetPrototype' # MUST do this at the start primarily due to tensorflow causing issues def fix_message_factory_issue():