mirror of
https://github.com/OpenBMB/MiniCPM-V.git
synced 2026-02-05 18:29:18 +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
|
device = args.device
|
||||||
assert device in ['cuda', 'mps']
|
assert device in ['cuda', 'mps']
|
||||||
if args.dtype == 'bf16':
|
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:
|
else:
|
||||||
dtype = torch.float16
|
dtype = torch.float16
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user