Skip to content
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

[server] add streaming am infer #1713

Merged
merged 7 commits into from
Apr 19, 2022
Merged

Conversation

lym0302
Copy link
Contributor

@lym0302 lym0302 commented Apr 18, 2022

PR types
New features

PR changes
add streaming am infer

Describe
add streaming am infer

@mergify mergify bot added the Server label Apr 18, 2022
@lym0302 lym0302 modified the milestones: r1.0.0, r1.0.0a Apr 18, 2022
self.voc_block = voc_block
self.voc_pad = voc_pad

def get_model_info(self, step, model_name, ckpt, stat):
Copy link
Collaborator

Choose a reason for hiding this comment

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

此处是否也加上 typehint?
step: str, model_name: str, ckpt: Path/str, 等

"""get model information

Args:
step (string): am or voc
Copy link
Collaborator

Choose a reason for hiding this comment

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

string -> str, python 不用 string

stat (string): stat file, including mean and standard deviation

Returns:
model, model_mu, model_std
Copy link
Collaborator

Choose a reason for hiding this comment

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

返回值
Returns:
Tensor: xxx
np.array : xxx
np.array : xxx
但是其实调用函数可能也不需要写这么多 docstring, 模型代码里面一般要写得清楚一点


return model, model_mu, model_std

def _get_pretrained_path(self, tag: str) -> os.PathLike:
Copy link
Collaborator

Choose a reason for hiding this comment

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

TTSExecutor 里面有这个函数了,是否可以不用写了
突然发现 TTSExecutor 里面这个函数也不用写,因为基类都写了..

@@ -116,11 +473,18 @@ def __init__(self, name=None):
super(TTSEngine, self).__init__()
Copy link
Collaborator

Choose a reason for hiding this comment

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

我们基类直接用这个 super().init()


if block_size == -1:
return [data]

Copy link
Collaborator

Choose a reason for hiding this comment

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

我这在区分 am 和 voc 的时候是用 filed, 如果保持一致,用户在看源码的时候可能会更容易理解变量的含义

def get_predictor(args, filed='am'):

Copy link
Collaborator

@zh794390558 zh794390558 left a comment

Choose a reason for hiding this comment

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

LGTM

@lym0302 lym0302 merged commit ab656aa into PaddlePaddle:develop Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants