-
Notifications
You must be signed in to change notification settings - Fork 343
vertexai: add frequency_penalty and presence_penalty #889
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
vertexai: add frequency_penalty and presence_penalty #889
Conversation
…tests * Updated _VertexAICommon class to include frequency_penalty and presence_penalty attributes. * Modified test cases to incorporate new parameters in model initialization and generation configuration.
…texAICommon class * Updated docstrings for frequency_penalty and presence_penalty attributes to provide clearer explanations of their effects on token generation.
| "Underlying model name." | ||
| temperature: Optional[float] = None | ||
| "Sampling temperature, it controls the degree of randomness in token selection." | ||
| frequency_penalty: Optional[float] = None |
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.
you need to extend _allow_model_args too, otherwise args sent to the invoke would be ignored
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. I added them to the gemma models -- that's the only place I see allowed_model_args used.
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.
I dont' think Gemma supports these params.
I'm sorry I wasn't clear, that's the place that should be modified:
| _allowed_params = [ |
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.
Sorry. I'm clearly missing something. frequency_penalty and presence_penalty are already there, no?
* Included frequency_penalty and presence_penalty in the GemmaVertexAIModelGarden and GemmaChatVertexAIModelGarden classes to enhance model configuration options.
| "Underlying model name." | ||
| temperature: Optional[float] = None | ||
| "Sampling temperature, it controls the degree of randomness in token selection." | ||
| frequency_penalty: Optional[float] = None |
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.
I dont' think Gemma supports these params.
I'm sorry I wasn't clear, that's the place that should be modified:
| _allowed_params = [ |
… classes * Eliminated frequency_penalty and presence_penalty from the GemmaVertexAIModelGarden and GemmaChatVertexAIModelGarden classes to streamline model configuration options.
PR Description
Adds
frequency_penaltyandpresence_penaltyto base model.Fixes issues where initializing ChatVertexAI with a
frequency_penaltyargument would log:Unexpected argument 'frequency_penalty' provided to ChatVertexAI.Type
🐛 Bug Fix