Skip to content

[Hackathon 7th] fix vits with CSMSC #3920

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

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

Liyulingyue
Copy link
Contributor

PR types

Others

PR changes

Others

Describe

  1. 修复了计算过程中类型冲突的问题
  2. 修复了0-tensor的问题

Copy link

paddle-bot bot commented Dec 1, 2024

Thanks for your contribution!

@mergify mergify bot added the T2S label Dec 1, 2024
Copy link
Collaborator

@zxcd zxcd left a comment

Choose a reason for hiding this comment

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

LGTM

@zxcd zxcd merged commit c33d9bf into PaddlePaddle:develop Dec 2, 2024
5 checks passed
@@ -181,6 +181,10 @@ def make_pad_mask(lengths, xs=None, length_dim=-1):
if length_dim == 0:
raise ValueError("length_dim cannot be 0: {}".format(length_dim))

# check if ilens is 0-dim tensor, if so, add a dimension
if lengths.ndim == 0:
Copy link
Collaborator

@zxcd zxcd Dec 2, 2024

Choose a reason for hiding this comment

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

bs = paddle.shape(lengths)
这个地方的报错统一修改成
if lengths.ndim == 0:
bs = paddle.shape(lengths.unsqueeze(0))
else:
bs = paddle.shape(lengths)

@Liyulingyue Liyulingyue deleted the csmsc-vits branch March 5, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants