diff options
author | Herman Semenov <GermanAizek@yandex.ru> | 2023-10-20 10:02:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-20 13:02:12 +0300 |
commit | f439e506e8ae8b01df2ae2156380f8156d7553e3 (patch) | |
tree | 59683267206e83bba460a13347caae31b7f0ea8e /common | |
parent | e78f3ef24af4ca74e77e725644b41ae8ca3b10a5 (diff) |
ggml : fix rope + llama minor optimizations (#3560)
* Minor fixes and fixed memleak
* Using const auto references in range-based loop C++17
Diffstat (limited to 'common')
-rw-r--r-- | common/grammar-parser.cpp | 2 | ||||
-rw-r--r-- | common/train.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/common/grammar-parser.cpp b/common/grammar-parser.cpp index 5a545a80..ff51cc80 100644 --- a/common/grammar-parser.cpp +++ b/common/grammar-parser.cpp @@ -399,7 +399,7 @@ namespace grammar_parser { void print_grammar(FILE * file, const parse_state & state) { try { std::map<uint32_t, std::string> symbol_id_names; - for (auto kv : state.symbol_ids) { + for (const auto & kv : state.symbol_ids) { symbol_id_names[kv.second] = kv.first; } for (size_t i = 0, end = state.rules.size(); i < end; i++) { diff --git a/common/train.cpp b/common/train.cpp index 972eaefe..154ca56e 100644 --- a/common/train.cpp +++ b/common/train.cpp @@ -1425,7 +1425,7 @@ void train_opt_callback(void * vdata, int accum_step, float * sched, bool * canc int impr_plot = -(int)(1 + (opt->loss_before - opt->loss_after) * 10.0f + 0.5f); if (impr_plot > 0) impr_plot = 0; - if (std::isnan(opt->loss_before) || std::isnan(opt->loss_before)) impr_plot = 0; + if (std::isnan(opt->loss_before) || std::isnan(opt->loss_after)) impr_plot = 0; printf("%s: iter=%6d sample=%zu/%zu sched=%f loss=%f", __func__, opt->iter, std::min(1+train->shuffle_next_sample, train->shuffle_sample_count), train->shuffle_sample_count, *sched, opt->loss_after); |