pub trait TokenizerEncoder: Send + Sync {
// Required method
fn encode_ids(&self, text: &str) -> Result<Vec<u32>, String>;
}Expand description
Encode text into model token ids.
Implemented for Tokenizer; other tokenizers can implement it to back a
prompt encoding.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".