oa::BpeTokenizer
Learns byte pair merges to build vocabulary from 256 base bytes to target size. Useful for compressing sequences and improving model efficiency.
Public Types
Public Methods
Examples
Constructor & Destructor Documentation
Public Method Documentation
Decode BPE tokens back to text
Parameters
inTokensconst oa::Vector<oa::I32> &—
Returns
oa::StringThe declared return value.
Encode text to BPE tokens
Parameters
inTextconst char *—
Returns
oa::Vector<oa::I32>The declared return value.
Encode prompt with padding to context length
Parameters
inPromptconst char *—
inContextLenoa::I32—
Returns
oa::Vector<oa::I32>The declared return value.
No public source comment is attached to this declaration.
Parameters
inPathconst oa::String &—
Returns
oa::StatusThe declared return value.
get number of learned merges
Returns
oa::I32The declared return value.
Persist/load the learned merge ranks. The format is deterministic and architecture-independent so a training checkpoint can ship its text vocab.
Parameters
inPathconst oa::String &—
Returns
oa::StatusThe declared return value.
Train BPE merges on text corpus
Parameters
inTextconst char *—
inNumMergesoa::I32—
Returns
voidThe declared return value.
get current vocabulary size
Returns
oa::I32The declared return value.