MCPcopy Create free account
hub / github.com/alibaba/MNN / load

Method load

transformers/diffusion/engine/src/tokenizer.cpp:27–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27bool MtokTokenizer::load(const std::string& filePath) {
28#if defined(MNN_DIFFUSION_WITH_LLM_TOKENIZER)
29 auto mtokPath = BuildMtokPath(filePath);
30 delete mTokenizer;
31 mTokenizer = MNN::Transformer::Tokenizer::createTokenizer(mtokPath);
32 if (mTokenizer == nullptr) {
33 MNN_ERROR("Failed to create tokenizer from %s\n", mtokPath.c_str());
34 }
35 return mTokenizer != nullptr;
36#else
37 (void)filePath;
38 MNN_ERROR("Diffusion tokenizer requires MNN_BUILD_LLM=ON and tokenizer.mtok\n");
39 return false;
40#endif
41}
42
43std::vector<int> MtokTokenizer::encodeSingle(const std::string& sentence, int maxlen) const {
44#if defined(MNN_DIFFUSION_WITH_LLM_TOKENIZER)

Callers 14

mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
SanaLlmMethod · 0.45
convert_modelsFunction · 0.45
read_model_typeFunction · 0.45
export_sd35_mtokFunction · 0.45
read_jsonFunction · 0.45
read_json_if_existsFunction · 0.45
read_model_typeFunction · 0.45

Calls 2

BuildMtokPathFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected