pub trait Tokenizer {
fn new(tokenizer_path: &str) -> Result<Self, String>
where
Self: Sized;
fn encode(&self, text: &str, bos: bool, eos: bool) -> Vec<u32>;
fn decode(&self, tokens: Vec<u32>) -> String;
fn bos(&self) -> String {
self.decode(vec![self.bos_id()])
}
fn bos_id(&self) -> u32;
fn eos(&self) -> String {
self.decode(vec![self.eos_id()])
}
fn eos_id(&self) -> u32;
fn stop_ids(&self) -> Vec<u32>;
}