@@ -168,8 +168,8 @@ class Stats:
168
168
169
169
# Raw stats from last model iteration.
170
170
finished_reason_lst : List [str ]
171
- num_prompt_tokens_lst : List [int ]
172
- num_generation_tokens_lst : List [int ]
171
+ num_prompt_tokens : List [int ]
172
+ num_generation_tokens : List [int ]
173
173
request_n : List [int ]
174
174
request_best_of : List [int ]
175
175
time_to_first_tokens : List [float ]
@@ -227,9 +227,9 @@ def _log_prometheus(self, stats: Stats) -> None:
227
227
228
228
# Add to token counters.
229
229
self .metrics .counter_prompt_tokens .labels (** self .labels ).inc (
230
- sum (stats .num_prompt_tokens_lst ))
230
+ sum (stats .num_prompt_tokens ))
231
231
self .metrics .counter_generation_tokens .labels (** self .labels ).inc (
232
- sum (stats .num_generation_tokens_lst ))
232
+ sum (stats .num_generation_tokens ))
233
233
234
234
# Add to request counters.
235
235
finished_reason_counter = CollectionsCounter (stats .finished_reason_lst )
@@ -241,10 +241,10 @@ def _log_prometheus(self, stats: Stats) -> None:
241
241
}).inc (count )
242
242
243
243
# Observe number of tokens in histograms.
244
- for val in stats .num_prompt_tokens_lst :
244
+ for val in stats .num_prompt_tokens :
245
245
self .metrics .histogram_request_prompt_tokens .labels (
246
246
** self .labels ).observe (val )
247
- for val in stats .num_generation_tokens_lst :
247
+ for val in stats .num_generation_tokens :
248
248
self .metrics .histogram_request_generation_tokens .labels (
249
249
** self .labels ).observe (val )
250
250
@@ -289,8 +289,8 @@ def log(self, stats: Stats) -> None:
289
289
self ._log_prometheus (stats )
290
290
291
291
# Save tracked stats for token counters.
292
- self .num_prompt_tokens .append (sum (stats .num_prompt_tokens_lst ))
293
- self .num_generation_tokens .append (sum (stats .num_generation_tokens_lst ))
292
+ self .num_prompt_tokens .append (sum (stats .num_prompt_tokens ))
293
+ self .num_generation_tokens .append (sum (stats .num_generation_tokens ))
294
294
295
295
# Log locally every local_interval seconds.
296
296
if self ._local_interval_elapsed (stats .now ):
0 commit comments