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

Fix decoder_input_details bug #705

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion proto/generate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ message Generation {
/// Request ID
uint64 request_id = 1;
/// Prefill tokens (optional)
PrefillTokens prefill_tokens = 2;
NextTokens prefill_tokens = 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just remove the PrefillTokens proto from here if it's not used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used in a couple of places in CausalLM and Seq2SeqLM. I'll replace it with NextTokens

/// Next tokens
NextTokens next_tokens = 3;
/// Complete generated text
Expand Down
3 changes: 1 addition & 2 deletions router/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ pub use pb::generate::v1::{
input_chunk, AdapterParameters, AlternativeTokens, Batch, CachedBatch, ClassifyPredictionList,
DownloadAdapterResponse, Embedding, Entity, EntityList, FinishReason, GeneratedText,
Generation, Image, InputChunk, MajoritySignMethod, MergeStrategy, NextTokenChooserParameters,
NextTokens, PrefillTokens, PreloadedAdapter, Request, StoppingCriteriaParameters,
TokenizedInputs,
NextTokens, PreloadedAdapter, Request, StoppingCriteriaParameters, TokenizedInputs,
};
pub use sharded_client::ShardedClient;
use thiserror::Error;
Expand Down
4 changes: 2 additions & 2 deletions router/src/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use itertools::izip;
use itertools::multizip;
use lorax_client::{
Batch, CachedBatch, ClassifyPredictionList, ClientError, Embedding, GeneratedText, Generation,
PrefillTokens, PreloadedAdapter, ShardedClient,
NextTokens, PreloadedAdapter, ShardedClient,
};
use minijinja::{Environment, ErrorKind, Template};
use minijinja_contrib::pycompat;
Expand Down Expand Up @@ -1527,7 +1527,7 @@ fn send_errors(error: ClientError, entries: &mut IntMap<u64, Entry>) {
pub(crate) enum InferStreamResponse {
// Optional first message
Prefill {
tokens: Option<PrefillTokens>,
tokens: Option<NextTokens>,
tokens_length: u32,
prefill_time: Instant,
},
Expand Down
4 changes: 2 additions & 2 deletions server/lorax_server/models/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class NextTokens:
is_special: List[bool]
alternative_tokens: Optional[List[AlternativeTokens]]

def to_pb(self) -> generate_pb2.PrefillTokens:
def to_pb(self) -> generate_pb2.NextTokens:
return generate_pb2.NextTokens(
ids=self.token_ids,
logprobs=self.logprobs,
Expand All @@ -118,7 +118,7 @@ def __len__(self):
@dataclass
class Generation:
request_id: int
prefill_tokens: Optional[PrefillTokens]
prefill_tokens: Optional[NextTokens]
prefill_tokens_length: int
next_tokens: NextTokens
generated_text: Optional[GeneratedText]
Expand Down
Loading