pub trait Encoder: Send + Sync {
// Required methods
fn encode(&self, input: &str, add_special_tokens: bool) -> Result<Encoding>;
fn encode_batch(
&self,
inputs: &[&str],
add_special_tokens: bool,
) -> Result<Vec<Encoding>>;
}Expand description
Core encoding trait - separate from decoding for modularity