From f673deaab8eba49d910c80abafca9caff8915b89 Mon Sep 17 00:00:00 2001 From: jorgeantonio21 Date: Sun, 31 Mar 2024 10:00:04 +0100 Subject: [PATCH] remove fetch method from ModelTrait --- atoma-inference/src/model_thread.rs | 2 +- atoma-inference/src/models/mod.rs | 3 --- atoma-inference/src/service.rs | 7 +------ 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/atoma-inference/src/model_thread.rs b/atoma-inference/src/model_thread.rs index 5b623aaa..bfe6475c 100644 --- a/atoma-inference/src/model_thread.rs +++ b/atoma-inference/src/model_thread.rs @@ -113,7 +113,7 @@ where ) -> Result<(Self, Vec>), ModelThreadError> where F: ApiTrait, - M: ModelTrait + M: ModelTrait + Send + 'static, { diff --git a/atoma-inference/src/models/mod.rs b/atoma-inference/src/models/mod.rs index 46f820bf..efc3978e 100644 --- a/atoma-inference/src/models/mod.rs +++ b/atoma-inference/src/models/mod.rs @@ -1,6 +1,5 @@ use std::path::PathBuf; -use crate::{apis::ApiTrait, models::config::ModelConfig}; use ed25519_consensus::VerificationKey as PublicKey; use thiserror::Error; @@ -16,11 +15,9 @@ pub trait ModelBuilder { pub trait ModelTrait { type Builder: Send + Sync + 'static; - type FetchApi: ApiTrait + Send + Sync + 'static; type Input; type Output; - fn fetch(api: &Self::FetchApi, config: ModelConfig) -> Result<(), ModelError>; fn load(filenames: Vec) -> Result where Self: Sized; diff --git a/atoma-inference/src/service.rs b/atoma-inference/src/service.rs index 076966aa..cf643641 100644 --- a/atoma-inference/src/service.rs +++ b/atoma-inference/src/service.rs @@ -35,7 +35,7 @@ where request_receiver: Receiver, ) -> Result where - M: ModelTrait + M: ModelTrait + Send + 'static, F: ApiTrait, @@ -200,14 +200,9 @@ mod tests { impl ModelTrait for TestModelInstance { type Builder = (); - type FetchApi = MockApi; type Input = (); type Output = (); - fn fetch(_: &Self::FetchApi, _: ModelConfig) -> Result<(), crate::models::ModelError> { - Ok(()) - } - fn load(_: Vec) -> Result { Ok(Self {}) }