Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tgaddair committed Feb 28, 2024
1 parent 06e0449 commit 80f1f2b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion router/client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ impl Client {
};

let max_new_tokens = max_total_tokens - max_input_length;
let request = tonic::Request::new(WarmupRequest { batch: Some(batch), max_new_tokens }).inject_context();
let request = tonic::Request::new(WarmupRequest {
batch: Some(batch),
max_new_tokens,
})
.inject_context();
let response = self.stub.warmup(request).await?.into_inner();
Ok(response.max_supported_total_tokens)
}
Expand Down
4 changes: 3 additions & 1 deletion router/client/src/sharded_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ impl ShardedClient {
let futures: Vec<_> = self
.clients
.iter_mut()
.map(|client| Box::pin(client.warmup(max_input_length, max_prefill_tokens, max_total_tokens)))
.map(|client| {
Box::pin(client.warmup(max_input_length, max_prefill_tokens, max_total_tokens))
})
.collect();
// Take the minimum value
let results = join_all(futures)
Expand Down
6 changes: 5 additions & 1 deletion router/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,11 @@ async fn main() -> Result<(), RouterError> {
// Warmup model
tracing::info!("Warming up model");
let max_supported_batch_total_tokens = match sharded_client
.warmup(max_input_length as u32, max_batch_prefill_tokens, max_total_tokens as u32)
.warmup(
max_input_length as u32,
max_batch_prefill_tokens,
max_total_tokens as u32,
)
.await
.map_err(RouterError::Warmup)?
{
Expand Down

0 comments on commit 80f1f2b

Please sign in to comment.