feat: use xpu as default if it exists
This commit is contained in:
parent
6065c5224e
commit
66b32b2e4e
2 changed files with 49 additions and 44 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -169,9 +169,14 @@ tags
|
||||||
.ruff_cache
|
.ruff_cache
|
||||||
|
|
||||||
# our proj
|
# our proj
|
||||||
|
/inputs/
|
||||||
/output/
|
/output/
|
||||||
/outputs/
|
/outputs/
|
||||||
/checkpoint/
|
/checkpoint/
|
||||||
/checkpoints/
|
/checkpoints/
|
||||||
exp
|
exp
|
||||||
.gradio/
|
.gradio/
|
||||||
|
|
||||||
|
*~
|
||||||
|
*swp
|
||||||
|
*swo
|
||||||
|
|
|
@ -167,7 +167,7 @@ def parse_args():
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--device",
|
"--device",
|
||||||
type=str,
|
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",
|
help="Device for inference: cuda | mps | cpu",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
|
Loading…
Reference in a new issue