Add --retry argument to control model retry attempts on failure

parent 2fe62c6f
Pipeline #227 canceled with stages
...@@ -3325,7 +3325,8 @@ def main(args): ...@@ -3325,7 +3325,8 @@ def main(args):
# Store original args for retry # Store original args for retry
args._auto_mode = True args._auto_mode = True
args._retry_count = 0 args._retry_count = 0
args._max_retries = 3 # Maximum number of model retries # Use --retry argument or default to 3
args._max_retries = getattr(args, 'retry', 3)
if args.distribute and args.interface: if args.distribute and args.interface:
os.environ["NCCL_SOCKET_IFNAME"] = args.interface os.environ["NCCL_SOCKET_IFNAME"] = args.interface
...@@ -4247,6 +4248,9 @@ List TTS voices: ...@@ -4247,6 +4248,9 @@ List TTS voices:
# Auto mode arguments # Auto mode arguments
parser.add_argument("--auto", action="store_true", parser.add_argument("--auto", action="store_true",
help="Automatic mode: detect generation type and NSFW from prompts, select best models automatically") help="Automatic mode: detect generation type and NSFW from prompts, select best models automatically")
parser.add_argument("--retry", type=int, default=3,
metavar="COUNT",
help="Number of retry attempts with alternative models when a model fails (default: 3, use 0 to disable)")
parser.add_argument("--prefer-speed", action="store_true", parser.add_argument("--prefer-speed", action="store_true",
help="In auto mode, prefer faster models over higher quality") help="In auto mode, prefer faster models over higher quality")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment