Skip to content

Commit

Permalink
check for the existence of the default accelerate config that can cre…
Browse files Browse the repository at this point in the history
…ate headaches (axolotl-ai-cloud#561)
  • Loading branch information
winglian committed Sep 13, 2023
1 parent cc4e161 commit 272707d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import yaml

# add src to the pythonpath so we don't need to pip install this
from accelerate.commands.config import config_args
from art import text2art
from transformers import GenerationConfig, TextStreamer

Expand Down Expand Up @@ -254,9 +255,17 @@ def load_datasets(
)


def check_accelerate_default_config():
if Path(config_args.default_yaml_config_file).exists():
LOG.warning(
f"accelerate config file found at {config_args.default_yaml_config_file}. This can lead to unexpected errors"
)


def do_cli(config: Path = Path("examples/"), **kwargs):
print_axolotl_text_art()
parsed_cfg = load_cfg(config, **kwargs)
check_accelerate_default_config()
parser = transformers.HfArgumentParser((TrainerCliArgs))
parsed_cli_args, _ = parser.parse_args_into_dataclasses(
return_remaining_strings=True
Expand Down

0 comments on commit 272707d

Please sign in to comment.