-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(google-common): Gemini logprobs #7472
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
@@ -189,8 +189,16 @@ export abstract class ChatGoogleBase<AuthOptions> | |||
|
|||
topK = 40; | |||
|
|||
presencePenalty = undefined; |
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.
Don't need to init as undefined
- should have their actual typing
stopSequences: string[] = []; | ||
|
||
logprobs: false; |
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 means that the only acceptable value is false
Did you mean to set logprobs = false
?
and topLogprobs = 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.
Doh! Yeah. Thanks for catching this.
const topTokens: GeminiLogprobsTopCandidate[] = | ||
logprobs?.topCandidates ?? []; | ||
const content: Logprob[] = []; | ||
for (let co = 0; co < chosenTokens.length; co += 1) { |
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.
nit: what does co
mean?
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.
Counter. (Throwback to my BASIC days.)
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.
Thanks! Some nits
Fixed the type declarations. Thanks! |
Add support for OpenAI compatible logprobs, including:
response_metadata
in the same format OpenAI usesAdd support for token selection updates in model parameters:
Added tests for same.