Skip to content

Commit

Permalink
handle edge case w logging
Browse files Browse the repository at this point in the history
  • Loading branch information
winglian committed Jan 23, 2024
1 parent 52a227d commit 064b20e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/axolotl/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 064b20e

Please sign in to comment.