Skip to content

Commit

Permalink
Fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
sidjha1 committed Nov 3, 2024
1 parent 0c86fc8 commit b05784a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lotus/models/lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def __call__(
return LMOutput(outputs=outputs, logprobs=logprobs)

def _update_stats(self, response: ModelResponse):
if not hasattr(response, "usage"):
return

self.stats.total_usage.prompt_tokens += response.usage.prompt_tokens
self.stats.total_usage.completion_tokens += response.usage.completion_tokens
self.stats.total_usage.total_tokens += response.usage.total_tokens
Expand Down

0 comments on commit b05784a

Please sign in to comment.