Update _utils.py
This commit is contained in:
parent
3e9d68bb80
commit
e88ea0ad7f
1 changed files with 3 additions and 2 deletions
|
|
@ -221,12 +221,13 @@ class _RaiseUninitialized(logging.Handler):
|
|||
def __init__(self):
|
||||
super().__init__()
|
||||
def emit(self, record):
|
||||
if "some weights of" in str(record).lower():
|
||||
record_lower = str(record).lower()
|
||||
if "some weights of" in record_lower and "score.weight" not in 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"\
|
||||
f"`pip install --upgrade --force-reinstall --no-cache-dir --no-deps unsloth unsloth_zoo transformers timm`\n"\
|
||||
f"".str(record))
|
||||
f"{str(record)}")
|
||||
pass
|
||||
class RaiseUninitialized:
|
||||
def __init__(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue