mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-23 06:12:50 +08:00
Update cli.py
Former-commit-id: 751dd77bc076af3a13884a609ec71c089c516f1f
This commit is contained in:
parent
55815ab1ff
commit
9bebdeabda
@ -71,10 +71,6 @@ def main():
|
|||||||
export_model()
|
export_model()
|
||||||
elif command == Command.TRAIN:
|
elif command == Command.TRAIN:
|
||||||
if get_device_count() > 0:
|
if get_device_count() > 0:
|
||||||
# NOTE (MengqingCao): why use torchrun when only one accelerator is available?
|
|
||||||
# DeepSpeed only warp model with DeepSpeedEngine when launching by distributed launcher,
|
|
||||||
# e.g., torchrun, causing some feature missing
|
|
||||||
# sa: https://github.com/huggingface/transformers/issues/24309
|
|
||||||
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))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user