diff --git a/examples/llama-bench/llama-bench.cpp b/examples/llama-bench/llama-bench.cpp index e7873a143..7278bb3ca 100644 --- a/examples/llama-bench/llama-bench.cpp +++ b/examples/llama-bench/llama-bench.cpp @@ -1095,6 +1095,8 @@ struct jsonl_printer : public printer { struct markdown_printer : public printer { std::vector fields; + std::vector prev_values; + static int get_field_width(const std::string & field) { if (field == "model") { return -30; @@ -1242,8 +1244,10 @@ struct markdown_printer : public printer { void print_test(const test & t) override { std::map vmap = t.get_map(); + std::vector values; fprintf(fout, "|"); + size_t i = 0; for (const auto & field : fields) { std::string value; char buf[128]; @@ -1292,9 +1296,20 @@ struct markdown_printer : public printer { // HACK: the utf-8 character is 2 bytes width += 1; } + values.push_back(value); + + if (prev_values.size() > i && prev_values.at(i) == value) { + value = ""; + } + + fprintf(fout, " %*s |", width, value.c_str()); + + i++; } fprintf(fout, "\n"); + + prev_values = std::move(values); } void print_footer() override {