From 7bebc629afe2044a96e2ee515a74be6a70534433 Mon Sep 17 00:00:00 2001 From: Morgan Funtowicz Date: Mon, 5 Aug 2024 13:39:14 +0000 Subject: [PATCH] (misc) missing Result types for Rust --- backends/trtllm/src/looper.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backends/trtllm/src/looper.rs b/backends/trtllm/src/looper.rs index 7d8058632..4bcf8a574 100644 --- a/backends/trtllm/src/looper.rs +++ b/backends/trtllm/src/looper.rs @@ -9,6 +9,7 @@ use hashbrown::HashMap; use log::warn; use tokenizers::{Encoding, Tokenizer}; use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender}; +use tokio::sync::mpsc::error::SendError; use tokio::task::{JoinHandle, spawn_blocking}; use tokio::time::Instant; use tokio_stream::wrappers::UnboundedReceiverStream; @@ -111,7 +112,7 @@ fn executor_status_poller( info!("New token for {} -> {}", request_id, step.token_id); if !step.has_error { - let req_group = grouper.entry_ref(&request_id).or_insert( + let req_group = grouper.entry(request_id).or_insert( DecodedTokenContext { tokens: vec![], ctx: ctx.streamer.clone(), // Arc::clone() = cheap @@ -138,7 +139,7 @@ fn executor_status_poller( grouper .into_values() .map(|ctx| post_processor_sender.send(ctx)) - .collect()?; + .collect::>>()?; } Err(err) => { error!("Failed to retrieve tokens from the executor: {}", err); @@ -146,7 +147,7 @@ fn executor_status_poller( } } - Ok(()) + Ok::<(), SendError>(()) }) { error!( "Caught an fatal error in the executor's loop, about to exit. {}",