修复Onnx导出的BUG (#237)

* Add files via upload

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

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

* Add files via upload

* Add files via upload

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

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

* Delete attentions_onnx.py

* Delete models_onnx.py

* Add files via upload

* Add files via upload

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

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

* Update __init__.py

* Update __init__.py

* Update __init__.py

* [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>
This commit is contained in:
Ναρουσέ·μ·γιουμεμί·Χινακάννα
2023-12-14 19:39:16 +08:00
committed by GitHub
parent bf9ab35e6e
commit 7a9ce8fc4c
2 changed files with 3 additions and 2 deletions

View File

@@ -50,6 +50,7 @@ def get_text(text, language_str, hps, device):
def get_emo_(reference_audio, emotion): def get_emo_(reference_audio, emotion):
from .emo_gen import get_emo from .emo_gen import get_emo
emo = ( emo = (
torch.from_numpy(get_emo(reference_audio)) torch.from_numpy(get_emo(reference_audio))
if reference_audio if reference_audio

View File

@@ -212,7 +212,7 @@ if __name__ == "__main__":
return {"status": 10, "detail": f"模型model_id={model_id}未加载"} return {"status": 10, "detail": f"模型model_id={model_id}未加载"}
# 检查是否提供speaker # 检查是否提供speaker
if speaker_name is None and speaker_id is None: if speaker_name is None and speaker_id is None:
logger.error(f"/voice 请求错误推理请求未提供speaker_name或speaker_id") logger.error("/voice 请求错误推理请求未提供speaker_name或speaker_id")
return {"status": 11, "detail": "请提供speaker_name或speaker_id"} return {"status": 11, "detail": "请提供speaker_name或speaker_id"}
elif speaker_name is None: elif speaker_name is None:
# 检查speaker_id是否存在 # 检查speaker_id是否存在
@@ -415,7 +415,7 @@ if __name__ == "__main__":
elif os.path.isfile(os.path.join(model_dir, "../config.json")): elif os.path.isfile(os.path.join(model_dir, "../config.json")):
config_path = os.path.join(model_dir, "../config.json") config_path = os.path.join(model_dir, "../config.json")
else: else:
logger.error(f"/models/add 模型添加失败未在模型所在目录以及上级目录找到config.json文件") logger.error("/models/add 模型添加失败未在模型所在目录以及上级目录找到config.json文件")
return { return {
"status": 15, "status": 15,
"detail": "查询未传入配置文件路径,同时默认路径./与../中不存在配置文件config.json。", "detail": "查询未传入配置文件路径,同时默认路径./与../中不存在配置文件config.json。",