auto switch mps device to cpu device

This commit is contained in:
Qing
2023-02-11 13:30:09 +08:00
parent f9b5dcbfd7
commit 8f8bcfe0f4
15 changed files with 52 additions and 19 deletions

View File

@@ -143,12 +143,6 @@ def parse_args():
"torch.cuda.is_available() is False, please use --device cpu or check your pytorch installation"
)
if args.device == "mps":
if args.model not in MPS_SUPPORT_MODELS:
parser.error(
f"mps only support: {MPS_SUPPORT_MODELS}, but got {args.model}"
)
if args.model_dir and args.model_dir is not None:
if os.path.isfile(args.model_dir):
parser.error(f"invalid --model-dir: {args.model_dir} is a file")