Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
42b9cd3342
|
|
@ -170,3 +170,4 @@ cython_debug/
|
|||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
.idea/
|
||||
.DS_Store
|
||||
Result.xlsx
|
||||
BIN
Result.xlsx
BIN
Result.xlsx
Binary file not shown.
7
run.py
7
run.py
|
|
@ -23,8 +23,11 @@ import yaml
|
|||
def main():
|
||||
args = parse_args()
|
||||
|
||||
# Set device
|
||||
if torch.cuda.is_available() and args['device'] != 'cpu':
|
||||
# Set device (prefer MPS on macOS, then CUDA, else CPU)
|
||||
if hasattr(torch.backends, 'mps') and torch.backends.mps.is_available() and args['device'] != 'cpu':
|
||||
args['device'] = 'mps'
|
||||
args['model']['device'] = args['device']
|
||||
elif torch.cuda.is_available() and args['device'] != 'cpu':
|
||||
torch.cuda.set_device(int(args['device'].split(':')[1]))
|
||||
args['model']['device'] = args['device']
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in New Issue