-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Pipelines] Refactor next_token to return dict[str,
TextGenerationResponse] This PR refactors the `next_token` interface to enable variable token length responses from the pipeline on a per-request basis. Instead of returning a `list[dict[str, TextResponse]]` and implicitly identifying request completion based on the keys returned in the dictionary. This PR refactors `next_token` to return a `dict[str, TextGenerationResponse]`, in which the dictionary keys align with the request ids provided. The newly introduced `TextGenerationResponse` includes variable token length arrays, and explicitly states the final status (`TextGenerationStatus`: ACTIVE, MAXIMUM_LENGTH, or END_OF_SEQUENCE).This hardens our interface to completion tracking, enables more complex decoding strategies, and provides the server the opportunity to provide a corrected `finish_reason`. MODULAR_ORIG_COMMIT_REV_ID: fa8c7ff5af9470d25d3f86c966c633f783cc37ec
- Loading branch information
1 parent
98333f2
commit e9be43e
Showing
5 changed files
with
89 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters