feat: use xpu as default if it exists

This commit is contained in:
Ayo Ayco 2025-09-02 23:13:40 +02:00
parent 6065c5224e
commit 66b32b2e4e
2 changed files with 49 additions and 44 deletions

5
.gitignore vendored
View file

@ -169,9 +169,14 @@ tags
.ruff_cache
# our proj
/inputs/
/output/
/outputs/
/checkpoint/
/checkpoints/
exp
.gradio/
*~
*swp
*swo

View file

@ -167,7 +167,7 @@ def parse_args():
parser.add_argument(
"--device",
type=str,
default=("cuda" if torch.cuda.is_available() else ("mps" if torch.backends.mps.is_available() else "cpu")),
default=("cuda" if torch.cuda.is_available() else ("mps" if torch.backends.mps.is_available() else ("xpu" if torch.xpu.is_available() else "cpu"))),
help="Device for inference: cuda | mps | cpu",
)
parser.add_argument(