avila-tokenizers 0.1.0

The most complete tokenizer library in Rust - BPE, WordPiece, Unigram, with native support for GPT, BERT, Llama, Claude
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub mod bert;
pub mod roberta;
pub mod template;

pub use bert::BertProcessing;
pub use roberta::RobertaProcessing;
pub use template::TemplateProcessing;

use crate::error::Result;

/// Trait for post-processing token IDs (adding special tokens, formatting, etc.)
pub trait PostProcessor: Send + Sync {
    /// Process token IDs, optionally with a second sequence
    fn process(&self, ids: Vec<u32>, pair_ids: Option<Vec<u32>>) -> Result<Vec<u32>>;
}