chore: improve error message

This commit is contained in:
NanoCode012
2025-06-19 18:22:04 +07:00
parent e97773d292
commit 533d5aaf4b

View File

@@ -64,7 +64,9 @@ class CutCrossEntropyPlugin(BasePlugin):
"cut_cross_entropy.transformers"
)
if cce_spec_transformers is None:
raise ImportError(_CCE_INSTALL_MESSAGE)
raise ImportError(
"Transformers support is not installed. " + _CCE_INSTALL_MESSAGE
)
# Check if Axolotl's cce fork is installed
try:
@@ -73,7 +75,10 @@ class CutCrossEntropyPlugin(BasePlugin):
if not AXOLOTL_CCE_FORK:
raise ImportError
except ImportError as e:
raise ImportError(_CCE_INSTALL_MESSAGE) from e
raise ImportError(
"Axolotl's fork of cut_cross_entropy is not installed. "
+ _CCE_INSTALL_MESSAGE
) from e
def pre_model_load(self, cfg):
"""Apply cut cross entropy before model loading if enabled."""