Skip to content

Conversation

@Ashutosh0x
Copy link

Resolves #483. This PR fixes a crash in make_seq2seq_fields when an empty prompt array is provided. The previous logic attempted to create a target mask with negative dimensions (len(prompt) - 1) when prompt was empty. The fix adds conditional logic to generate a correct mask (based on response length) if the prompt is empty.

@google-cla
Copy link

google-cla bot commented Jan 4, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Ashutosh0x
Copy link
Author

Hi @epot, just submitted this fix for the crash in make_seq2seq_fields when handling empty prompts (Issue #483). The logic now correctly handles the mask generation when prompt length is 0, preventing the negative dimension error in
p.zeros. Thanks for reviewing!

@Ashutosh0x
Copy link
Author

I have signed the CLA.

@epot
Copy link

epot commented Jan 5, 2026

@Ashutosh0x I am not sure why you tagged me, but it's likely a mistake :)

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.

make_seq2seq_fields crashes with confusing error when empty prompt array is passed

2 participants