From 2c7c8d24da46509ec713a3f6129aae287d857b3b Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 17 Oct 2025 06:43:11 -0700 Subject: [PATCH] Update _utils.py --- unsloth/models/_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index e713c8efff..6379fb1505 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -356,7 +356,8 @@ class _RaiseUninitialized(logging.Handler): ("score.weight" not in record_lower) and \ ("classifier.weight" not in record_lower) and \ ("cls.predictions" not in record_lower) and \ - ("predictions.decoder" not in record_lower): + ("predictions.decoder" not in record_lower) and \ + (os.environ.get("UNSLOTH_WARN_UNINITIALIZED", "1") == "1"): raise Exception( f"Unsloth: Critical error since some weights are not initialized.\n"\ f"Please try updating Unsloth, transformers and timm via:\n"\