Skip to content

Commit c4d29ba

Browse files
authored
server : fix divide-by-zero in metrics reporting (ggml-org#11915)
1 parent 2eea03d commit c4d29ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/server/server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3656,7 +3656,7 @@ int main(int argc, char ** argv) {
36563656
}, {
36573657
{"name", "n_busy_slots_per_decode"},
36583658
{"help", "Average number of busy slots per llama_decode() call"},
3659-
{"value", (float) res_metrics->n_busy_slots_total / (float) res_metrics->n_decode_total}
3659+
{"value", (float) res_metrics->n_busy_slots_total / std::max((float) res_metrics->n_decode_total, 1.f)}
36603660
}}},
36613661
{"gauge", {{
36623662
{"name", "prompt_tokens_seconds"},

0 commit comments

Comments
 (0)