Aatricks commited on
Commit
8778aac
·
verified ·
1 Parent(s): 8075b4d

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. modules/Device/Device.py +2 -2
modules/Device/Device.py CHANGED
@@ -1457,9 +1457,9 @@ def should_use_fp16(
1457
  if torch.version.hip:
1458
  return True
1459
 
1460
- try :
1461
  props = torch.cuda.get_device_properties("cuda")
1462
- except AssertionError:
1463
  return False
1464
  if props.major >= 8:
1465
  return True
 
1457
  if torch.version.hip:
1458
  return True
1459
 
1460
+ if torch.cuda.is_available():
1461
  props = torch.cuda.get_device_properties("cuda")
1462
+ else:
1463
  return False
1464
  if props.major >= 8:
1465
  return True