diff --git a/src/llamafactory/cli.py b/src/llamafactory/cli.py index fbe18d86..8ae3d6a8 100644 --- a/src/llamafactory/cli.py +++ b/src/llamafactory/cli.py @@ -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))