pub trait Predictor: Send + Sync {
// Required methods
async fn forward(&self, inputs: Example) -> Result<Prediction>;
async fn forward_with_config(
&self,
inputs: Example,
lm: Arc<LM>,
) -> Result<Prediction>;
// Provided methods
async fn batch(&self, inputs: Vec<Example>) -> Result<Vec<Prediction>> { ... }
async fn batch_with_config(
&self,
inputs: Vec<Example>,
lm: Arc<LM>,
) -> Result<Vec<Prediction>> { ... }
}Required Methods§
async fn forward(&self, inputs: Example) -> Result<Prediction>
async fn forward_with_config( &self, inputs: Example, lm: Arc<LM>, ) -> Result<Prediction>
Provided Methods§
async fn batch(&self, inputs: Vec<Example>) -> Result<Vec<Prediction>>
async fn batch_with_config( &self, inputs: Vec<Example>, lm: Arc<LM>, ) -> Result<Vec<Prediction>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.