diff --git a/src/Module.hpp b/src/Module.hpp index 36903f9a..b724905b 100644 --- a/src/Module.hpp +++ b/src/Module.hpp @@ -103,7 +103,7 @@ class Module { mllm_time_init(); loader = ¶m_loader; - Module::doLoad = true; + doLoad = true; vector tmps; int max_in_size = 5; for (int i = 0; i < max_in_size; ++i) { @@ -137,7 +137,7 @@ class Module { } uint64_t time_end = mllm_time_us(); load_time_ = (time_end - time_start) / 1000.0F; // ms - Module::doLoad = false; + doLoad = false; } virtual vector Forward(vector inputs, vector args) = 0; @@ -148,7 +148,7 @@ class Module { // set static tmp_device to device_ to init layers' op auto previoud_device = tmp_device; Module::tmp_device = device_; - if (llm_model_ptr->doLoad) { + if (llm_model_ptr && llm_model_ptr->doLoad) { auto outputs = Forward(inputs, anyArgs); // for inner module, set output tensors to GRAPH_OUTPUT if (inputs[0].ttype() != TensorType::INPUT_TENSOR) { // XPUs' module should not be the outermost input tensor