Skip to main content

Crate pretokie

Crate pretokie 

Source
Expand description

Fast pretokenizers for BPE tokenizers.

Each pretokenizer is a zero-allocation, single-pass iterator over text pieces.

§Example

use pretokie::Gpt2;

let pieces: Vec<&str> = Gpt2::new("Hello world").collect();
assert_eq!(pieces, vec!["Hello", " world"]);

Modules§

util
Shared byte-level utilities.

Structs§

Bert
Cl100kConfig
Core
DeepSeekConfig
Gpt2Config
O200kConfig
QwenConfig
SmolLMConfig
VoyageConfig

Type Aliases§

Cl100k
DeepSeek
Gpt2
O200k
Qwen
SmolLM
Voyage