NAME

PDL::Tokenizers - Pure-Perl BPE and HuggingFace tokenizer.json support for PDL

SYNOPSIS

use PDL::Tokenizers;

my $tok = PDL::Tokenizers->from_file('tokenizer.json');
my $ids = $tok->encode('hello world');   # PDL long ndarray
my $txt = $tok->decode($ids);

DESCRIPTION

PDL::Tokenizers provides BPE tokenization and HuggingFace tokenizer.json loading in pure Perl, encoding text directly into PDL long token-ID ndarrays for downstream inference in PDL::Torch, PDL::ONNX, or PDL::GGML.

AUTHOR

C.J. Collier <cjac@google.com>

LICENSE AND COPYRIGHT

Copyright 2026 Google LLC. Apache License, Version 2.0.