Skip to content

(fix): fix get_pad_mask for eos_token_id and pad_token_id. - #304

Merged
PanAndy merged 1 commit into
mainfrom
yali/fix_get_pad_mask_github
Dec 22, 2025
Merged

(fix): fix get_pad_mask for eos_token_id and pad_token_id.#304
PanAndy merged 1 commit into
mainfrom
yali/fix_get_pad_mask_github

Conversation

@PanAndy

@PanAndy PanAndy commented Dec 22, 2025

Copy link
Copy Markdown
Collaborator

(fix): fix get_pad_mask for eos_token_id and pad_token_id.

qwen3系列base模型eos token与pad token相同 原有的get pad mask会把eos token也mask掉
修复内容:如果eos=pad,第一个pad token(即eos位置)会保留
修复前后结果对比:

qwen3-8b-base:
image
image
image

qwen3-30ba3b-base: 修复后
image
image
image

@PanAndy
PanAndy merged commit 1f9d217 into main Dec 22, 2025
6 checks passed
@PanAndy
PanAndy deleted the yali/fix_get_pad_mask_github branch December 22, 2025 08:40
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.

1 participant