Unverified Commit ecf94725 authored by Honora Green's avatar Honora Green Committed by GitHub

fix [baichuan] Error: argument of type 'NoneType' is not iterable (#2351)

Co-authored-by: 's avatarbaiyansong <baiyansong@hotmail.com>
parent a5861271
......@@ -31,6 +31,9 @@ parameter_rules:
use_template: presence_penalty
- name: frequency_penalty
use_template: frequency_penalty
default: 1
min: 1
max: 2
- name: with_search_enhance
label:
zh_Hans: 搜索增强
......
......@@ -31,6 +31,9 @@ parameter_rules:
use_template: presence_penalty
- name: frequency_penalty
use_template: frequency_penalty
default: 1
min: 1
max: 2
- name: with_search_enhance
label:
zh_Hans: 搜索增强
......
......@@ -31,6 +31,9 @@ parameter_rules:
use_template: presence_penalty
- name: frequency_penalty
use_template: frequency_penalty
default: 1
min: 1
max: 2
- name: with_search_enhance
label:
zh_Hans: 搜索增强
......
......@@ -125,6 +125,9 @@ class BaichuanModel(object):
'content': message.content,
'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
# turbo api accepts flat parameters
return {
'model': self._model_mapping(model),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment