MCPcopy Create free account
hub / github.com/M4THYOU/TokenDagger / byte_pair_encode

Function byte_pair_encode

src/tiktoken/tiktoken.cpp:371–378  ·  view source on GitHub ↗

Byte pair encoding

Source from the content-addressed store, hash-verified

369
370 // Byte pair encoding
371 void byte_pair_encode(const std::vector<unsigned char>& piece, const emhash8::HashMap<std::vector<unsigned char>, int, VectorHashEmhash>& encoder, std::vector<int>& result) {
372 if (piece.size() == 1) {
373 result.push_back(encoder.at(piece));
374 return;
375 }
376 // TODO: stuff
377 bpe_merge(piece, encoder, result);
378 }
379
380} // namespace tiktoken

Callers 2

encode_ordinaryMethod · 0.85
encodeMethod · 0.85

Calls 2

bpe_mergeFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected