Skip to main content

ModelApplicator

Trait ModelApplicator 

Source
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(非同期)

サーバー起動/停止などの重い処理を非同期で実行するため、 applyrollback は async メソッド。

Required Methods§

Source

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,

モデルを適用する(非同期)

Source

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,

指定したモデルにロールバック(非同期)

Source

fn current(&self) -> Option<TrainedModel>

現在適用中のモデル

Source

fn previous_model_id(&self) -> Option<LoraModelId>

前のモデル ID(rollback 用)

Implementors§