mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-22 22:02:51 +08:00
Merge pull request #4590 from injet-zhou/main
Exit the process with the subprocess's return code when utilizing the CLI Former-commit-id: 33ef6f4ec2984a686b6158c4f84af354349221aa
This commit is contained in:
commit
ecbbed94d9
@ -91,7 +91,7 @@ def main():
|
|||||||
master_addr = os.environ.get("MASTER_ADDR", "127.0.0.1")
|
master_addr = os.environ.get("MASTER_ADDR", "127.0.0.1")
|
||||||
master_port = os.environ.get("MASTER_PORT", str(random.randint(20001, 29999)))
|
master_port = os.environ.get("MASTER_PORT", str(random.randint(20001, 29999)))
|
||||||
logger.info("Initializing distributed tasks at: {}:{}".format(master_addr, master_port))
|
logger.info("Initializing distributed tasks at: {}:{}".format(master_addr, master_port))
|
||||||
subprocess.run(
|
subproc = subprocess.run(
|
||||||
(
|
(
|
||||||
"torchrun --nnodes {nnodes} --node_rank {node_rank} --nproc_per_node {nproc_per_node} "
|
"torchrun --nnodes {nnodes} --node_rank {node_rank} --nproc_per_node {nproc_per_node} "
|
||||||
"--master_addr {master_addr} --master_port {master_port} {file_name} {args}"
|
"--master_addr {master_addr} --master_port {master_port} {file_name} {args}"
|
||||||
@ -106,6 +106,7 @@ def main():
|
|||||||
),
|
),
|
||||||
shell=True,
|
shell=True,
|
||||||
)
|
)
|
||||||
|
sys.exit(subproc.returncode)
|
||||||
else:
|
else:
|
||||||
run_exp()
|
run_exp()
|
||||||
elif command == Command.WEBDEMO:
|
elif command == Command.WEBDEMO:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user