Fix: Added specific check for Gemma so models like BERT properly initialize

This commit is contained in:
Sekinal 2025-07-28 22:47:58 -06:00
commit e6bb5b83b9

View file

@ -221,7 +221,7 @@ class _RaiseUninitialized(logging.Handler):
def __init__(self):
super().__init__()
def emit(self, record):
if "some weights of" in str(record).lower():
if "some weights of" in str(record).lower() and "gemma" in str(record).lower():
raise Exception(
f"Unsloth: Critical error since some weights are not initialized.\n"\
f"Please try updating Unsloth, transformers and timm via:\n"\