Update import_fixes.py

This commit is contained in:
Daniel Han 2025-09-03 20:12:42 -07:00
commit 48db7e552d

View file

@ -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():