Skip to content

Commit 94ab11f

Browse files
committed
fix progeress bar
1 parent ce09234 commit 94ab11f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lora.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ struct LoraModel : public GGMLRunner {
147147
}
148148
} else {
149149
const std::string& name = tensor_storage.name;
150-
auto iter = lora_tensors.find(name);
150+
auto iter = lora_tensors.find(name);
151151
if (iter != lora_tensors.end()) {
152152
*dst_tensor = iter->second;
153153
}

model.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,7 +2264,8 @@ bool ModelLoader::load_tensors(on_new_tensor_cb_t on_new_tensor_cb, int n_thread
22642264
if (current_idx >= file_tensors.size() || failed) {
22652265
break;
22662266
}
2267-
pretty_progress(total_tensors_processed + current_idx, total_tensors_to_process, (ggml_time_ms() - t_start) / 1000.0f);
2267+
size_t curr_num = total_tensors_processed + current_idx;
2268+
pretty_progress(curr_num, total_tensors_to_process, (ggml_time_ms() - t_start) / 1000.0f / (curr_num + 1e-6f));
22682269
std::this_thread::sleep_for(std::chrono::milliseconds(200));
22692270
}
22702271

@@ -2277,11 +2278,10 @@ bool ModelLoader::load_tensors(on_new_tensor_cb_t on_new_tensor_cb, int n_thread
22772278
break;
22782279
}
22792280
total_tensors_processed += file_tensors.size();
2280-
}
2281-
2282-
pretty_progress(total_tensors_processed, total_tensors_to_process, (ggml_time_ms() - t_start) / 1000.0f);
2283-
if (total_tensors_to_process > 0) {
2284-
printf("\n");
2281+
pretty_progress(total_tensors_processed, total_tensors_to_process, (ggml_time_ms() - t_start) / 1000.0f / (total_tensors_processed + 1e-6f));
2282+
if (total_tensors_processed < total_tensors_to_process) {
2283+
printf("\n");
2284+
}
22852285
}
22862286

22872287
int64_t end_time = ggml_time_ms();

0 commit comments

Comments
 (0)