Skip to content

Commit

Permalink
Fix accelerate test with new config_file errors (#1169)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgugger committed Mar 9, 2023
1 parent 4352d3d commit 1a63f7d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/accelerate/commands/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ def test_command_parser(subparsers=None):
def test_command(args):
script_name = os.path.sep.join(__file__.split(os.path.sep)[:-2] + ["test_utils", "scripts", "test_script.py"])

test_args = f"""
--config_file={args.config_file} {script_name}
""".split()
cmd = ["accelerate-launch"] + test_args
if args.config_file is None:
test_args = script_name
else:
test_args = f"--config_file={args.config_file} {script_name}"

cmd = ["accelerate-launch"] + test_args.split()
result = execute_subprocess_async(cmd, env=os.environ.copy())
if result.returncode == 0:
print("Test is a success! You are ready for your distributed training!")
Expand Down

0 comments on commit 1a63f7d

Please sign in to comment.