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

set empty list of suppress tokens to None #36344

Conversation

Lewington-pitsos
Copy link

@Lewington-pitsos Lewington-pitsos commented Feb 22, 2025

What does this PR do?

Fixes #36341

pytest /tests/pipelines/ run locally and the same number of tests fail on main as on this branch

14 failed, 146 passed, 161 skipped, 25 warnings in 857.97s (0:14:17) 

this may not be the best way to solve the issue, but it looked like other aspects of the config were being overridden at this point.

Arguably the line prev_start_of_text = suppress_tokens[-2] if suppress_tokens is not None else None which is causing the errors should be changed instead though it has been here for > 1 year so I assume the same kind of check exists in a lot of places in the codebase.

This new state of affairs is probably more in-line with existing documentation than before as in multiple places the docs state that this parameter should be a list and don't mention anything about overriding with None e.g. https://huggingface.co/docs/transformers/v4.49.0/en/internal/generation_utils#transformers.FlaxSuppressTokensLogitsProcessor

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,

@Rocketknight1 @ylacombe

@Rocketknight1
Copy link
Member

cc @gante for generation config - do you know if this usage of suppress_tokens is correct?

@gante
Copy link
Member

gante commented Feb 26, 2025

Hey @Lewington-pitsos 👋

I believe we merged an equivalent fix yesterday: #36336

Let us know whether the underlying issue is fixed with the PR linked above, or whether we need to merge your suggested fix as well 🤗

[@Rocketknight1 yup, supress_tokens can be an empty list, and it should be equivalent to being None. ]

@Lewington-pitsos
Copy link
Author

#36336 fixes the issue yes, good stuff guys!

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.

suppress_tokens=[] should be legal as some older. whisper models rely on this
3 participants