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

Add with_sequence for decode stream #1725

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Add with_sequence for decode stream #1725

wants to merge 7 commits into from

Conversation

ArthurZucker
Copy link
Collaborator

No description provided.

@ArthurZucker ArthurZucker changed the title Add form sequence for decode stream Add with_sequence for decode stream Jan 21, 2025
@njhill
Copy link

njhill commented Jan 21, 2025

Thank you for this @ArthurZucker!

What do you think about having a version of step that can take a sequence tokens? That could be used for prefilling and also for incrementing the stream with chunks of tokens when needed?

I'm also thinking through how this would be used in practice. For very long prompts, we ideally don't want to decode the whole thing since we would typically already have just tokenized the text prompt. But we need the last couple of prompt tokens to ensure we can continue the prompt text cleanly such that the concatenation of the first streamed string with the original prompt is exactly equal to all of the tokens being decoded together.

Perhaps that's up to the user of the API to sort out, but it might be nice for the prefilled tokens to be excluded from the subsequent step output (or at least have the option for that).

@ArthurZucker
Copy link
Collaborator Author

For sure! I am actually a lot less familiar than you about the actual use-cases! Super thankful for the feedback!
Indeed makes senses that you don't want it all. Was wondering if this is also compatible with batches in general or not, as each sample needs a stream with the current implementation

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.

2 participants