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

Method Encode

external/sentencepiece/src/sentencepiece_processor.cc:379–390  ·  view source on GitHub ↗

///////////////////////////////////////////////////////// Simple API.

Source from the content-addressed store, hash-verified

377//////////////////////////////////////////////////////////////
378// Simple API.
379util::Status SentencePieceProcessor::Encode(
380 absl::string_view input, std::vector<std::string> *pieces) const {
381 CHECK_OR_RETURN_STATUS_STL(pieces);
382
383 SentencePieceText spt;
384 RETURN_IF_ERROR(Encode(input, &spt));
385 for (const auto &sp : spt.pieces()) {
386 pieces->emplace_back(sp.piece());
387 }
388
389 return util::OkStatus();
390}
391
392util::Status SentencePieceProcessor::Encode(absl::string_view input,
393 std::vector<int> *ids) const {

Callers 1

SampleEncodeMethod · 0.45

Calls 5

OkStatusFunction · 0.85
piecesMethod · 0.45
sizeMethod · 0.45
idMethod · 0.45
NormalizeMethod · 0.45

Tested by

no test coverage detected