From 25f25f9d30e787583bb2c8cf9de0ad93ecbaa204 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 20 Nov 2025 00:06:11 -0800 Subject: [PATCH] Update loader_utils.py --- unsloth/models/loader_utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/unsloth/models/loader_utils.py b/unsloth/models/loader_utils.py index f5504be2c8..e4f5bca636 100644 --- a/unsloth/models/loader_utils.py +++ b/unsloth/models/loader_utils.py @@ -262,11 +262,14 @@ def _check_load_in_fp8_settings( # Check if torchao has this PR: https://github.com/pytorch/ao/pull/3158, # which will be released in 0.15.0. - error_message = "Unsloth: `load_in_fp8` requires torchao 0.15.0+ (or nightly)" if importlib.util.find_spec("torchao") is None: - raise ValueError(error_message) + raise ValueError("Unsloth: Please install torchao for on the fly float8 to work!") import torchao + error_message = \ + "Unsloth: `load_in_fp8` requires torchao 0.15.0+ (or nightly).\n"\ + f"You have torchao version={torchao.__version__}\n"\ + "Use `pip install --upgrade --force-reinstall torchao`" if Version(torchao.__version__) < Version("0.15.0"): raise ValueError(error_message)