From 2755b62d1244b94cfff301dae9e03869b0656d0d Mon Sep 17 00:00:00 2001 From: Eugene Rakhmatulin Date: Wed, 18 Mar 2026 13:26:39 -0700 Subject: [PATCH] Fixes #108 --- run-recipe.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/run-recipe.py b/run-recipe.py index ffa8506..f130dda 100755 --- a/run-recipe.py +++ b/run-recipe.py @@ -462,12 +462,13 @@ def generate_launch_script(recipe: dict[str, Any], overrides: dict[str, Any], is # (not needed for solo; no-ray uses PyTorch distributed instead) if is_solo or no_ray: import re - # Remove the entire line containing --distributed-executor-backend - # This handles multi-line commands with backslash continuations + # Remove just the flag and its value, not the whole line + command = re.sub(r'--distributed-executor-backend\s+\S+', '', command) + # Remove lines that are now empty or just a backslash continuation lines_list = command.split('\n') filtered_lines = [ - line for line in lines_list - if '--distributed-executor-backend' not in line + line for line in lines_list + if line.strip() not in ('', '\\') ] command = '\n'.join(filtered_lines)