From 8f2db72aec3d0c0654d20d64401e4a2e2ef5546e Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 21 Nov 2024 02:27:07 -0800 Subject: [PATCH] Update _utils.py --- unsloth/models/_utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 460b23bd0d..62881db09b 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -147,6 +147,14 @@ try: except: pass +# The model weights are not tied. Please use the `tie_weights` method before using the `infer_auto_device` function. +try: + from accelerate.utils.modeling import logger as accelerate_utils_modeling_logger + accelerate_utils_modeling_logger.addFilter(HideLoggingMessage("The model weights are not tied")) + del accelerate_utils_modeling_logger +except: + pass + # ============================================= # =============================================