Skip to main content
Version: 0.11.x

Function: loadTokenizer()

loadTokenizer(tokenizerPath): Tokenizer

Defined in: extensions/nlp/tokenizer.ts:104

Loads a HuggingFace tokenizer from a local tokenizer.json file.

Parameters​

tokenizerPath​

string

Absolute local path to a tokenizer.json file.

Returns​

Tokenizer

The loaded native Tokenizer instance.

Throws​

With code LOAD_FAILED if the tokenizer file fails to load or parse.