mirror of
https://github.com/OpenBMB/MiniCPM-V.git
synced 2026-02-04 09:49:20 +08:00
Add warning when inference with mps and bf16 on Mac
This commit is contained in:
@@ -26,7 +26,11 @@ args = parser.parse_args()
|
||||
device = args.device
|
||||
assert device in ['cuda', 'mps']
|
||||
if args.dtype == 'bf16':
|
||||
dtype = torch.bfloat16
|
||||
if device == 'mps':
|
||||
print('Warning: MPS does not support bf16, will use fp16 instead')
|
||||
dtype = torch.float16
|
||||
else:
|
||||
dtype = torch.bfloat16
|
||||
else:
|
||||
dtype = torch.float16
|
||||
|
||||
|
||||
Reference in New Issue
Block a user