mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-30 08:42:00 +00:00 
			
		
		
		
	llama-bench : skip repeated values in consecutive lines
This commit is contained in:
		| @@ -1095,6 +1095,8 @@ struct jsonl_printer : public printer { | |||||||
| struct markdown_printer : public printer { | struct markdown_printer : public printer { | ||||||
|     std::vector<std::string> fields; |     std::vector<std::string> fields; | ||||||
|  |  | ||||||
|  |     std::vector<std::string> prev_values; | ||||||
|  |  | ||||||
|     static int get_field_width(const std::string & field) { |     static int get_field_width(const std::string & field) { | ||||||
|         if (field == "model") { |         if (field == "model") { | ||||||
|             return -30; |             return -30; | ||||||
| @@ -1242,8 +1244,10 @@ struct markdown_printer : public printer { | |||||||
|  |  | ||||||
|     void print_test(const test & t) override { |     void print_test(const test & t) override { | ||||||
|         std::map<std::string, std::string> vmap = t.get_map(); |         std::map<std::string, std::string> vmap = t.get_map(); | ||||||
|  |         std::vector<std::string> values; | ||||||
|  |  | ||||||
|         fprintf(fout, "|"); |         fprintf(fout, "|"); | ||||||
|  |         size_t i = 0; | ||||||
|         for (const auto & field : fields) { |         for (const auto & field : fields) { | ||||||
|             std::string value; |             std::string value; | ||||||
|             char buf[128]; |             char buf[128]; | ||||||
| @@ -1292,9 +1296,20 @@ struct markdown_printer : public printer { | |||||||
|                 // HACK: the utf-8 character is 2 bytes |                 // HACK: the utf-8 character is 2 bytes | ||||||
|                 width += 1; |                 width += 1; | ||||||
|             } |             } | ||||||
|  |             values.push_back(value); | ||||||
|  |  | ||||||
|  |             if (prev_values.size() > i && prev_values.at(i) == value) { | ||||||
|  |                 value = ""; | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |  | ||||||
|             fprintf(fout, " %*s |", width, value.c_str()); |             fprintf(fout, " %*s |", width, value.c_str()); | ||||||
|  |  | ||||||
|  |             i++; | ||||||
|         } |         } | ||||||
|         fprintf(fout, "\n"); |         fprintf(fout, "\n"); | ||||||
|  |  | ||||||
|  |         prev_values = std::move(values); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     void print_footer() override { |     void print_footer() override { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 slaren
					slaren