verbose failure message (#1694)

This commit is contained in:
Wing Lian
2024-06-09 20:09:36 -04:00
committed by GitHub
parent 851ccb1237
commit cbbf039a46

View File

@@ -2,9 +2,12 @@
import importlib
import inspect
import logging
from axolotl.prompt_strategies.user_defined import UserDefinedDatasetConfig
LOG = logging.getLogger("axolotl.prompt_strategies")
def load(strategy, tokenizer, cfg, ds_cfg):
try:
@@ -22,5 +25,8 @@ def load(strategy, tokenizer, cfg, ds_cfg):
if "ds_cfg" in sig.parameters:
load_kwargs["ds_cfg"] = ds_cfg
return func(tokenizer, cfg, **load_kwargs)
except Exception: # pylint: disable=broad-exception-caught
except ModuleNotFoundError:
return None
except Exception as exc: # pylint: disable=broad-exception-caught
LOG.error(f"Failed to load prompt strategy `{strategy}`: {str(exc)}")
return None