Skip to content

Commit

Permalink
fix: baichuan frequency_penalty (#2446)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly authored Feb 14, 2024
1 parent 21c9d9e commit e47b5b4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ def _build_parameters(self, model: str, stream: bool, messages: list[BaichuanMes
'role': message.role,
})
# [baichuan] frequency_penalty must be between 1 and 2
if parameters['frequency_penalty'] < 1 or parameters['frequency_penalty'] > 2:
parameters['frequency_penalty'] = 1
if 'frequency_penalty' in parameters:
if parameters['frequency_penalty'] < 1 or parameters['frequency_penalty'] > 2:
parameters['frequency_penalty'] = 1

# turbo api accepts flat parameters
return {
'model': self._model_mapping(model),
Expand Down

0 comments on commit e47b5b4

Please sign in to comment.