-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Avoid ZeroDivisionError if output_tokens is 0 #54
base: main
Are you sure you want to change the base?
Conversation
42cd346
to
fcc944c
Compare
When testing HF TGIS im hitting
|
result.py
Outdated
self.tpot = ( | ||
self.response_time / self.output_tokens | ||
) # Time per output token in ms | ||
if self.output_tokens is not None and self.output_tokens > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks quite like
if self.output_tokens is not None and self.output_tokens > 0: | |
if self.output_tokens: |
as output_tokens
cannot be negative.
Not sure what's better...
(same below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ouuhhh I got the actual error self.output_tokens
is 1 and self.output_token exists
This commit validates that when calculating the results if output_tokens is 0 then both itl and tpot must be None.
This commit validates that when calculating the results if output_tokens is 0 then both itl and tpot must be None.