UNPKG
bpe-tokenizer-encoding
Version:
latest (2.0.0)
2.0.0
1.2.0
1.1.0
1.0.0
A simple JavaScript implementation of Byte Pair Encoding (BPE)
bpe-tokenizer-encoding
/
cli.js
9 lines
(6 loc)
•
268 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
#!/usr/bin/env node
const
{ bytePairEncoding } =
require
(
"./index"
);
const
input = process.
argv
[
2
] ||
"low_low_lower"
;
const
merges =
parseInt
(process.
argv
[
3
] ||
"5"
,
10
);
const
result =
bytePairEncoding
(input, merges,
true
);
console
.
log
(
"\nFinal Tokens:"
, result);