in scripts/launcher_distributed.py [0:0]
def training_function():
print_env_vars()
# Step 1: Map values to functions
function_map = {
"fine-tune": finetune_model,
"run-eval": run_eval,
"run-quant": run_quant,
}
# Step 2: Iterate through the array and call the corresponding functions
for value in args.tune_action.split(","):
if value in function_map:
print(f"function_key: {value}")
try:
if value != "fine-tune" and dist.is_initialized():
print(
"Destroying current process group before executing the next action..."
)
dist.destroy_process_group()
function_map[value]()
except Exception as e:
print(f"An error occurred in function {value}: {e}")
raise e
else:
print(f"No function defined for value {value}")