Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 8db4b72

Browse files
authored
collapse conditional
1 parent 304308d commit 8db4b72

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

torchchat/cli/cli.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,9 @@ def arg_init(args):
540540
else:
541541
args.device = get_device_str(args.device)
542542
executor_handler = args.quantize.get("executor", None)
543-
if executor_handler:
544-
if executor_handler["accelerator"] != args.device:
545-
print(f'overriding json-specified device {executor_handler["accelerator"]} with cli device {args.device}')
546-
executor_handler["accelerator"] = args.device
543+
if executor_handler and executor_handler["accelerator"] != args.device:
544+
print(f'overriding json-specified device {executor_handler["accelerator"]} with cli device {args.device}')
545+
executor_handler["accelerator"] = args.device
547546

548547
if "mps" in args.device:
549548
if getattr(args, "compile", False) or getattr(args, "compile_prefill", False):

0 commit comments

Comments
 (0)