From f3d1b295d1cb339de17bc875a3b43961b33c3a9d Mon Sep 17 00:00:00 2001 From: Martin Stefcek Date: Fri, 5 Apr 2024 11:56:42 +0400 Subject: [PATCH] fix clippy --- atoma-inference/src/model_thread.rs | 2 +- atoma-inference/src/models/config.rs | 2 +- atoma-inference/src/service.rs | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/atoma-inference/src/model_thread.rs b/atoma-inference/src/model_thread.rs index d9946c1b..345112a5 100644 --- a/atoma-inference/src/model_thread.rs +++ b/atoma-inference/src/model_thread.rs @@ -60,7 +60,7 @@ pub struct ModelThread { receiver: mpsc::Receiver, } -impl<'a, M> ModelThread +impl ModelThread where M: ModelTrait, { diff --git a/atoma-inference/src/models/config.rs b/atoma-inference/src/models/config.rs index 0f825150..22c404c1 100644 --- a/atoma-inference/src/models/config.rs +++ b/atoma-inference/src/models/config.rs @@ -150,7 +150,7 @@ pub mod tests { true, vec![ModelConfig::new( "Llama2_7b".to_string(), - PrecisionBits::F16, + serde_json::to_value(PrecisionBits::F16).unwrap(), "".to_string(), 0, )], diff --git a/atoma-inference/src/service.rs b/atoma-inference/src/service.rs index c2e1eb35..4360538e 100644 --- a/atoma-inference/src/service.rs +++ b/atoma-inference/src/service.rs @@ -146,7 +146,7 @@ mod tests { use std::io::Write; use toml::{toml, Value}; - use crate::{models::types::PrecisionBits, models::ModelId}; + use crate::models::{ModelId, Request, Response}; use super::*; @@ -196,6 +196,7 @@ mod tests { type Input = (); type Output = (); type Fetch = (); + type Load = (); fn fetch(_fetch: &Self::Fetch) -> Result<(), crate::models::ModelError> { Ok(()) @@ -203,7 +204,7 @@ mod tests { fn load( _: Vec, - _: PrecisionBits, + _: Self::Load, _device_id: usize, ) -> Result { Ok(Self {}) @@ -239,12 +240,12 @@ mod tests { file.write_all(toml_string.as_bytes()) .expect("Failed to write to file"); - let (_, req_receiver) = tokio::sync::mpsc::channel::<()>(1); - let (resp_sender, _) = tokio::sync::mpsc::channel::<()>(1); + let (_, req_receiver) = tokio::sync::mpsc::channel::(1); + let (resp_sender, _) = tokio::sync::mpsc::channel::(1); let config = ModelsConfig::from_file_path(CONFIG_FILE_PATH.parse().unwrap()); - let _ = ModelService::<(), ()>::start::( + let _ = ModelService::start::( config, private_key, req_receiver,