Skip to content

Commit bf76a1e

Browse files
committed
check num_tokens=0
1 parent f650358 commit bf76a1e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/llm/src/http/service/metrics.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ impl InflightGuard {
319319
}
320320

321321
pub(crate) fn observe_response(&mut self, isl: usize, num_tokens: usize) {
322+
if num_tokens == 0 {
323+
return;
324+
}
325+
322326
if self.is_first_token {
323327
// NOTE: when there are multiple tokens in the first response,
324328
// we use the full response time as TTFT and ignore the ITL

0 commit comments

Comments
 (0)