Merge pull request #4082 from MengqingCao/bugfix

Fix #4077

Former-commit-id: 288028c3fb6bb1b58d1b7f4e8b90108c9bbf27d1
This commit is contained in:
hoshi-hiyouga 2024-06-06 23:38:40 +08:00 committed by GitHub
commit b96b995620

View File

@ -72,7 +72,7 @@ def main():
elif command == Command.EXPORT:
export_model()
elif command == Command.TRAIN:
if get_device_count() > 1:
if get_device_count() > 0:
master_addr = os.environ.get("MASTER_ADDR", "127.0.0.1")
master_port = os.environ.get("MASTER_PORT", str(random.randint(20001, 29999)))
logger.info("Initializing distributed tasks at: {}:{}".format(master_addr, master_port))