Skip to content

Commit

Permalink
Merge branch 'main' into develop-zh
Browse files Browse the repository at this point in the history
  • Loading branch information
UbiquitousLearning authored Oct 26, 2024
2 parents 6ef60c5 + 9630033 commit 2388adb
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 @@ -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
Expand Down

0 comments on commit 2388adb

Please sign in to comment.