Skip to content

Commit

Permalink
fix: Update Module.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
UbiquitousLearning authored Oct 26, 2024
1 parent ea17acf commit 9630033
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Module.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Module {
mllm_time_init();

loader = &param_loader;
Module::doLoad = true;
doLoad = true;
vector<Tensor> tmps;
int max_in_size = 5;
for (int i = 0; i < max_in_size; ++i) {
Expand Down Expand Up @@ -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<Tensor> Forward(vector<Tensor> inputs, vector<std::any> args) = 0;
Expand All @@ -147,7 +147,7 @@ class Module {
vector<std::any> anyArgs = convertArgsToAnyVector(args...);
// set static tmp_device to device_ to init layers' op
Module::tmp_device = device_;
if (llm_model_ptr->doLoad) {
if (llm_model_ptr && llm_model_ptr->doLoad) {
return Forward(inputs, anyArgs);
}
if (inputs[0].ttype() == TensorType::INPUT_TENSOR) {
Expand Down

0 comments on commit 9630033

Please sign in to comment.