more fixes

This commit is contained in:
Adil Hafeez 2025-03-15 17:08:42 -07:00
parent f809eae5fd
commit 54f67ce2be
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
4 changed files with 25 additions and 15 deletions

View file

@ -159,11 +159,11 @@ impl StreamContext {
// Tokenize and record token count.
let token_count = tokenizer::token_count(model, json_string).unwrap_or(0);
trace!("Recorded input token count: {}", token_count);
// Record the token count to metrics.
self.metrics
.input_sequence_length
.record(token_count as u64);
trace!("Recorded input token count: {}", token_count);
// Check if rate limiting needs to be applied.
if let Some(selector) = self.ratelimit_selector.take() {