fix: baichuan frequency_penalty (#2446)

This commit is contained in:
Yeuoly 2024-02-14 20:11:41 +08:00 committed by GitHub
parent 21c9d9e200
commit e47b5b43b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -128,8 +128,10 @@ class BaichuanModel:
'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),