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

Batching and generate_until special tokens #2723

Open
sjmielke opened this issue Feb 21, 2025 · 0 comments
Open

Batching and generate_until special tokens #2723

sjmielke opened this issue Feb 21, 2025 · 0 comments

Comments

@sjmielke
Copy link
Contributor

models.huggingface.generate_until has a step to cut off response suffixes that occur after end tokens in:

# use secondary stop seqs to cut off should-have-been-stopped content post-hoc

...which should help with cases of batching where the batch generation of:

cont = self._model_generate(

...is leaving other sequences too long otherwise.

The problem is that using, say a special token <|eot_id|> as an EOS token, we would want this decode to preserve that token:

s = self.tok_decode(cont_toks)

...but it doesn't because skip_special_tokens defaults to True. Should it be set to false here? I don't have the bigger picture to decide if that would break other things, but we are encountering this issue of things not being truncated, so if you have any other ideas for how to remedy that well, please let me know!

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