Skip to content

Commit

Permalink
Merge pull request phidatahq#217 from shailensobhee/main
Browse files Browse the repository at this point in the history
More detailed LLM performance metrics added to Logger.
  • Loading branch information
ashpreetbedi committed May 5, 2024
2 parents a6db51c + 4101843 commit bb74a4a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions phi/llm/ollama/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ def response_stream(self, messages: List[Message]) -> Iterator[str]:
yield response_content

response_timer.stop()
logger.debug(f"Number of tokens generated: {completion_tokens}")
logger.debug(f"Time per output token: {response_timer.elapsed/completion_tokens:.4f}s")
logger.debug(f"Throughtput: {completion_tokens/response_timer.elapsed:.4f} tokens/s")
logger.debug(f"Time to generate response: {response_timer.elapsed:.4f}s")

# -*- Create assistant message
Expand Down

0 comments on commit bb74a4a

Please sign in to comment.