MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / text_to_token

Method text_to_token

external/llama_tokenizer/bpe-core.cpp:530–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528} // namespace
529
530int32_t BpeVocabulary::text_to_token(const std::string & text) const {
531 const auto it = token_to_id.find(text);
532 return it == token_to_id.end() ? -1 : it->second;
533}
534
535int BpeVocabulary::find_bpe_rank(const std::string & left, const std::string & right) const {
536 const auto it = bpe_ranks.find(pair_key(left, right));

Callers 1

tokenizeMethod · 0.80

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected