1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! # Public Vocabulary Information
//!
//! Common Stats, Public Patterns, and Pretrained Model Sources
//!
//! ## Loading Pretrained Models
//!
//! Loading a pre-trained model requires reading the vocabulary,
//! as well as configuring the spanners (regex and special words)
//! configuration.
//!
//! For a number of pretrained models, simplified constructors are
//! available to download, cache, and load the vocabulary.
//!
//! ```rust,no_run
//! use std::sync::Arc;
//!
//! use wordchipper::{
//! Tokenizer,
//! TokenizerOptions,
//! UnifiedTokenVocab,
//! disk_cache::WordchipperDiskCache,
//! load_vocab,
//! };
//!
//! fn example() -> wordchipper::WCResult<Arc<Tokenizer<u32>>> {
//! let mut disk_cache = WordchipperDiskCache::default();
//! let loaded = load_vocab("openai:o200k_harmony", &mut disk_cache)?;
//!
//! let tokenizer =
//! TokenizerOptions::default().build(loaded.vocab().clone());
//!
//! Ok(tokenizer)
//! }
//! ```
pub use ;