Skip to content

Commit

Permalink
fix: auto backend logics
Browse files Browse the repository at this point in the history
  • Loading branch information
gremlinflat committed Mar 17, 2023
1 parent 3423a33 commit 6b5815c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion inference_realesrgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ def main():

# deternime backend type (cpu, cuda, mps)
if args.backend_type == 'auto':
backend_type = 'cuda' if cudaIsAvailable() else 'cpu'
if cudaIsAvailable():
backend_type = 'cuda'
elif mpsIsAvailable():
backend_type = 'mps'
else:
backend_type = 'cpu'
elif args.backend_type == 'cuda' and cudaIsAvailable():
backend_type = 'cuda'
elif args.backend_type == 'mps' and mpsIsAvailable():
Expand Down

0 comments on commit 6b5815c

Please sign in to comment.