-
Notifications
You must be signed in to change notification settings - Fork 46
feat(metrics): add generation_tokens_total and prompt_tokens_total metrics #268
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
base: main
Are you sure you want to change the base?
Conversation
100bb9f to
b49b40b
Compare
mayabar
left a comment
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.
Added some comments regarding buckets limits
786cd5d to
4ee6b72
Compare
…trics Signed-off-by: CYJiang <[email protected]>
4ee6b72 to
41b7839
Compare
mayabar
left a comment
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.
some additional comments
| nBuckets := len(buckets) | ||
| nCounts := len(counts) | ||
|
|
||
| for i := 0; i <= nBuckets; i++ { |
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.
Usually the counts array will be shorter than the buckets array, seems better to iterate till counts' length.
| if i < nCounts { | ||
| count = counts[i] | ||
| } |
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.
in else of this if we can start this loop since got the end of the counts array
consider
if i>= nCounts {
break
}
.. use counts[i]
| // Each value will be passed to Observe() once at start-up. | ||
| // exactly once during initialization. Additionally: |
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.
please fix the sentence
| switch { | ||
| case i == 0: | ||
| // First bucket: [0, buckets[0]] | ||
| lower = 0.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.
lower can be initialized before the loop + processing of the last bucket could be done after the loop - in this case no need for switch
No description provided.