Skip to content

Commit

Permalink
mps support
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Zichen committed Jan 24, 2024
1 parent 382102c commit cb9d8fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
parser.add_argument("-dt", "--default_refer_text", type=str, default="", help="默认参考音频文本")
parser.add_argument("-dl", "--default_refer_language", type=str, default="", help="默认参考音频语种")

parser.add_argument("-d", "--device", type=str, default=g_config.infer_device, help="cuda / cpu")
parser.add_argument("-d", "--device", type=str, default=g_config.infer_device, help="cuda / cpu / mps")
parser.add_argument("-p", "--port", type=int, default=g_config.api_port, help="default: 9880")
parser.add_argument("-a", "--bind_addr", type=str, default="127.0.0.1", help="default: 127.0.0.1")
parser.add_argument("-fp", "--full_precision", action="store_true", default=False, help="覆盖config.is_half为False, 使用全精度")
Expand Down Expand Up @@ -290,6 +290,7 @@ def handle(command, refer_wav_path, prompt_text, prompt_language, text, text_lan
wav.seek(0)

torch.cuda.empty_cache()
torch.mps.empty_cache()
return StreamingResponse(wav, media_type="audio/wav")


Expand Down

0 comments on commit cb9d8fe

Please sign in to comment.