verbose failure message (#1694)
This commit is contained in:
@@ -2,9 +2,12 @@
|
|||||||
|
|
||||||
import importlib
|
import importlib
|
||||||
import inspect
|
import inspect
|
||||||
|
import logging
|
||||||
|
|
||||||
from axolotl.prompt_strategies.user_defined import UserDefinedDatasetConfig
|
from axolotl.prompt_strategies.user_defined import UserDefinedDatasetConfig
|
||||||
|
|
||||||
|
LOG = logging.getLogger("axolotl.prompt_strategies")
|
||||||
|
|
||||||
|
|
||||||
def load(strategy, tokenizer, cfg, ds_cfg):
|
def load(strategy, tokenizer, cfg, ds_cfg):
|
||||||
try:
|
try:
|
||||||
@@ -22,5 +25,8 @@ def load(strategy, tokenizer, cfg, ds_cfg):
|
|||||||
if "ds_cfg" in sig.parameters:
|
if "ds_cfg" in sig.parameters:
|
||||||
load_kwargs["ds_cfg"] = ds_cfg
|
load_kwargs["ds_cfg"] = ds_cfg
|
||||||
return func(tokenizer, cfg, **load_kwargs)
|
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
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user