Skip to content
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

"ZeroDivisionError" when no tokens are generated. #7

Closed
lmg-anon opened this issue Nov 18, 2023 · 2 comments
Closed

"ZeroDivisionError" when no tokens are generated. #7

lmg-anon opened this issue Nov 18, 2023 · 2 comments

Comments

@lmg-anon
Copy link

Here is the relevant information:

  File "G:\Projects\tabbyAPI\model.py", line 358, in generate_gen
    print(f"Response: {round(generated_tokens, 2)} tokens generated in {round(elapsed_time, 2)} seconds ({round(generated_tokens / elapsed_time, 2)} T/s)")
                                                                                                                ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
ZeroDivisionError: float division by zero
bdashore3 added a commit that referenced this issue Nov 19, 2023
Model: Add extra information to print and fix the divide by zero error.
Auth: Fix validation of API and admin keys to look for the entire key.

References #7 and #6

Signed-off-by: kingbri <[email protected]>
@bdashore3
Copy link
Member

bdashore3 commented Nov 19, 2023

Please check 6b9af58. The console will say "Indeterminate" which is technically the correct value of 0/0

@lmg-anon
Copy link
Author

Looks like it works 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants