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

confused with function generation(), https://github.com/huggingface/trl/blob/main/trl/trainer/utils.py#L1323 #2579

Open
luoyingyan opened this issue Jan 17, 2025 · 0 comments

Comments

@luoyingyan
Copy link

I am very confused with this line: input_ids = torch.masked_fill(queries, ~attention_mask, 0)
It seems to replace the pad_token_id with 0, Why is this step necessary?

@luoyingyan luoyingyan changed the title confused with https://github.com/huggingface/trl/blob/main/trl/trainer/utils.py#L949 confused with function generation(), https://github.com/huggingface/trl/blob/main/trl/trainer/utils.py#L1323 Jan 17, 2025
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

No branches or pull requests

1 participant