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.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
.idea/
|
.idea/
|
||||||
.DS_Store
|
.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():
|
def main():
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
|
|
||||||
# Set device
|
# Set device (prefer MPS on macOS, then CUDA, else CPU)
|
||||||
if torch.cuda.is_available() and args['device'] != '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]))
|
torch.cuda.set_device(int(args['device'].split(':')[1]))
|
||||||
args['model']['device'] = args['device']
|
args['model']['device'] = args['device']
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue