pub trait ModelApplicator: Send + Sync {
// Required methods
fn apply<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 TrainedModel,
) -> Pin<Box<dyn Future<Output = Result<(), ApplicatorError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn rollback<'life0, 'life1, 'async_trait>(
&'life0 self,
to: &'life1 LoraModelId,
) -> Pin<Box<dyn Future<Output = Result<(), ApplicatorError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn current(&self) -> Option<TrainedModel>;
fn previous_model_id(&self) -> Option<LoraModelId>;
}Expand description
モデル適用 trait(非同期)
サーバー起動/停止などの重い処理を非同期で実行するため、
apply と rollback は async メソッド。
Required Methods§
Sourcefn apply<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 TrainedModel,
) -> Pin<Box<dyn Future<Output = Result<(), ApplicatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn apply<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 TrainedModel,
) -> Pin<Box<dyn Future<Output = Result<(), ApplicatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
モデルを適用する(非同期)
Sourcefn rollback<'life0, 'life1, 'async_trait>(
&'life0 self,
to: &'life1 LoraModelId,
) -> Pin<Box<dyn Future<Output = Result<(), ApplicatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn rollback<'life0, 'life1, 'async_trait>(
&'life0 self,
to: &'life1 LoraModelId,
) -> Pin<Box<dyn Future<Output = Result<(), ApplicatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
指定したモデルにロールバック(非同期)
Sourcefn current(&self) -> Option<TrainedModel>
fn current(&self) -> Option<TrainedModel>
現在適用中のモデル
Sourcefn previous_model_id(&self) -> Option<LoraModelId>
fn previous_model_id(&self) -> Option<LoraModelId>
前のモデル ID(rollback 用)