Skip to content

Commit

Permalink
server : fix divide-by-zero in metrics reporting (#11915)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviallon authored Feb 17, 2025
1 parent 2eea03d commit c4d29ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3656,7 +3656,7 @@ int main(int argc, char ** argv) {
}, {
{"name", "n_busy_slots_per_decode"},
{"help", "Average number of busy slots per llama_decode() call"},
{"value", (float) res_metrics->n_busy_slots_total / (float) res_metrics->n_decode_total}
{"value", (float) res_metrics->n_busy_slots_total / std::max((float) res_metrics->n_decode_total, 1.f)}
}}},
{"gauge", {{
{"name", "prompt_tokens_seconds"},
Expand Down

0 comments on commit c4d29ba

Please sign in to comment.