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

Method load_model

src/common/AutoModel/modeling_qwen3_5vl.cpp:16–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14Qwen3_5VL::Qwen3_5VL(xrt::device* npu_device_inst) : AutoModel(npu_device_inst, "Qwen3_5VL") {}
15
16void Qwen3_5VL::load_model(std::string model_path, json model_info, int default_context_length, bool enable_preemption) {
17 this->_shared_load_model(model_path, model_info, default_context_length, enable_preemption);
18
19 this->q4nx = std::make_unique<Q4NX>(this->model_path);
20 // lm_config->model_type == qwen3
21 this->lm_engine = std::make_unique<qwen3_5vl_npu>(*this->lm_config, this->npu.get(), this->MAX_L);
22
23 this->lm_engine->load_weights(*this->q4nx);
24 //free the q4nx
25 this->q4nx.reset();
26 this->lm_engine->clear_context();
27 this->setup_tokenizer(model_path);
28 this->sampler.reset();
29
30 this->enable_tool = (model_info["size"] > 800000000)? true : false;
31
32 sampler_config config;
33 config.top_k = 20;
34 config.top_p = 0.8;
35 config.min_p = 0.0;
36 config.temperature = 0.7;
37 config.rep_penalty = 1.0;
38 config.freq_penalty = 1.0;
39 config.pre_penalty = 1.5f;
40
41 this->set_sampler(config);
42 for (size_t i = 0; i < PROFILER_TYPE_NUM; i++) {
43 this->profiler_list[i].reset();
44 }
45}
46
47void Qwen3_5VL::setup_tokenizer(std::string model_path) {
48 auto tokenizer_config = this->_shared_setup_tokenizer(model_path);

Callers

nothing calls this directly

Calls 6

setup_tokenizerMethod · 0.95
clear_contextMethod · 0.80
set_samplerMethod · 0.80
_shared_load_modelMethod · 0.45
getMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected