Skip to content

Commit

Permalink
Apple's MPS backend support (#259)
Browse files Browse the repository at this point in the history
* Update webui.py

添加了对于Mac的mps支持,现在可以将device设置为mps来用Mac进行推理

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Aintor and pre-commit-ci[bot] authored Jun 2, 2024
1 parent f6622bf commit 6b4d5c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ def inference(
)

with torch.autocast(
device_type=decoder_model.device.type, dtype=args.precision
device_type=(
"cpu"
if decoder_model.device.type == "mps"
else decoder_model.device.type
),
dtype=args.precision,
):
fake_audios = decode_vq_tokens(
decoder_model=decoder_model,
Expand Down

0 comments on commit 6b4d5c8

Please sign in to comment.