MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / EncodeBatch

Method EncodeBatch

src/include/tokenizer/tokenizers_cpp.h:37–45  ·  view source on GitHub ↗

! * \brief Encode a batch of texts into ids. * \param texts The input texts. * \returns The encoded token ids. */

Source from the content-addressed store, hash-verified

35 * \returns The encoded token ids.
36 */
37 virtual std::vector<std::vector<int32_t>> EncodeBatch(const std::vector<std::string>& texts) {
38 // Fall back when the derived class does not implement this function.
39 std::vector<std::vector<int32_t>> ret;
40 ret.reserve(texts.size());
41 for (const auto& text : texts) {
42 ret.push_back(Encode(text));
43 }
44 return ret;
45 }
46
47 /*!
48 * \brief Decode token ids into text.

Callers

nothing calls this directly

Calls 3

push_backMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected