Skip to content

add text to pinyin model as tts frontend #3506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

zxcd
Copy link
Contributor

@zxcd zxcd commented Mar 3, 2025

No description provided.

Copy link

paddle-bot bot commented Mar 3, 2025

Thanks for your contribution!


Predict:
batch_size: 1
input: "欢迎使用飞桨"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里建议使用 txt文件路径,文字放到txt文件中。这样和其他模型保持统一。

Yields:
list: list of file path.
"""
if isinstance(inputs, str):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议在现有基础上,额外支持 str 为本地txt文件路径。

Comment on lines +39 to +45
assert len(simplified_charcters) == len(simplified_charcters)

s2t_dict = {}
t2s_dict = {}
for i, item in enumerate(simplified_charcters):
s2t_dict[item] = traditional_characters[i]
t2s_dict[traditional_characters[i]] = item
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段代码放到tranditional_to_simplified()中吧

Comment on lines +54 to +56
opencc
onnxruntime
pypinyin
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

按照最新的paddlex第三方依赖规范,这三个包似乎属于【三类特殊依赖】,应该放到setup.py中的EXTRAS中。且最新规范中,requirements.txt已经废弃不再使用。具体请参考:
https://ku.baidu-int.com/knowledge/HFVrC7hq1Q/yKeL8Lljko/YkH5mORwJ3/X1tDrwm1qSK2Zx

from typing import Tuple

import numpy as np
import onnxruntime
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

依据最新的paddlex第三方依赖管理规范,onnxruntime 应该不是默认安装的依赖库,不应在顶层import,并考虑使用function_requires_deps修饰相关调用函数。具体请参考:https://ku.baidu-int.com/knowledge/HFVrC7hq1Q/yKeL8Lljko/YkH5mORwJ3/X1tDrwm1qSK2Zx

"fix_mode": None,
"count_json": "train.count.json",
},
"lr": 5e-5,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个配置文件是做什么的呢?为什么还有学习率配置

)
elif char in self.char_bopomofo_dict:
partial_result[i] = pypinyin_result[i][0]
# partial_result[i] = self.style_convert_func(self.char_bopomofo_dict[char][0])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

调试代码的话就删掉吧

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个tokenizer的改动也是和这个模型相关的吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants