Skip to content

Commit

Permalink
给配置文件功能加上is_half选项
Browse files Browse the repository at this point in the history
  • Loading branch information
xudiandian committed Apr 9, 2024
1 parent 27debe2 commit d4c4b50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"gpt_path":"./models/gpt.ckpt",
"default_refer_path":"./models/referaudio.wav",
"default_refer_text":"参考文本",
"default_refer_language":"zh"
"default_refer_language":"zh",
"is_half":false
}
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
default_refer_path = config["default_refer_path"]
default_refer_text = config["default_refer_text"]
default_refer_language = config["default_refer_language"]
is_half = config["is_half"]
# 自动判断环境是否支持CUDA和DirectML
if(torch.cuda.is_available()):
print("CUDA可用,将使用CUDA进行推理加速。")
Expand All @@ -48,7 +49,6 @@
device = torch_directml.device(0)
print("DirectML可用,将使用DirectML进行推理加速。")
print("设备名称:",torch_directml.device_name(0))
is_half = False
# -----------------------

# 如果要增加更多的参数选项,在这里设定
Expand Down

0 comments on commit d4c4b50

Please sign in to comment.