encoderfile 0.6.2

Distribute and run transformer encoders with a single file.
Documentation
1
2
3
4
5
6
7
8
use crate::{common::FromCliInput, error::ApiError, services::Metadata};

pub trait Inference: Metadata {
    type Input: FromCliInput + serde::de::DeserializeOwned + Sync + Send + utoipa::ToSchema;
    type Output: serde::Serialize + Sync + Send + utoipa::ToSchema;

    fn inference(&self, request: impl Into<Self::Input>) -> Result<Self::Output, ApiError>;
}