diff --git a/src/axolotl/train.py b/src/axolotl/train.py index 79b8802345..5fb873edd9 100644 --- a/src/axolotl/train.py +++ b/src/axolotl/train.py @@ -47,10 +47,14 @@ def train( *, cfg: DictDefault, cli_args: TrainerCliArgs, dataset_meta: TrainDatasetMeta ) -> Tuple[Union[PeftModel, PreTrainedModel], PreTrainedTokenizer]: # load the tokenizer first - LOG.debug( - f"loading tokenizer... {cfg.tokenizer_config or cfg.base_model_config}", - main_process_only=True, - ) + try: + LOG.debug( + f"loading tokenizer... {cfg.tokenizer_config or cfg.base_model_config}", + main_process_only=True, + ) + except RuntimeError: + # sometimes Accelerator() needs to be called un-necessarily before using logging + pass tokenizer = load_tokenizer(cfg) train_dataset = dataset_meta.train_dataset