Repository navigation
[Hackathon 7th] 修复 s2t 示例错误 - #3950
Merged
Merged
Conversation
|
Thanks for your contribution! |
zxcd
reviewed
Dec 16, 2024
| config['subsampling_factor'] = 1 | ||
| config['num_encs'] = 1 | ||
| config['shortest_first'] = False | ||
| config['minibatches'] = 0 |
Collaborator
There was a problem hiding this comment.
load the params from config?
Collaborator
Author
There was a problem hiding this comment.
细说???
这里的 config 本来就是 clone 过来的,应该是本来就木有这几个值,还需要从哪里 load?最好是有默认值 ~
| ys_in_lens: paddle.Tensor, | ||
| r_ys_in_pad: paddle.Tensor=paddle.empty([0]), | ||
| reverse_weight: float=0.0) -> Tuple[paddle.Tensor, paddle.Tensor]: | ||
| def forward(self, |
Collaborator
Author
There was a problem hiding this comment.
typing hint for the output changed from
-> Tuple[paddle.Tensor, paddle.Tensor]:to
-> Tuple[paddle.Tensor, paddle.Tensor, paddle.Tensor]:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR types
Bug fixes
PR changes
Others
Describe
修复
s2t示例错误:paddlespeech/s2t/io/dataloader.py中,如果走train分支,那么config会缺少很多配置项paddlespeech/s2t/models/u2_st/u2_st.py中,使用的是TransformerDecoder,这个类中forward有3个返回值,因此使用*_屏蔽掉第一个之后的返回值。之所以不使用decoder_out, _, _ = self.decode...的方式,是因为,TransformerDecoder的forward原来的输出可能是2个(之前的 typing 只有两个返回值,这里同时修改为三个),因此,用*_做兼容性处理。paddlespeech/s2t/frontend/featurizer/text_featurizer.py的输入可能是嵌套的 list,因此这里也做了判断处理。目前测试暂时没啥问题,日志:
@zxcd @Liyulingyue @GreatV @enkilee @yinfan98