Limit number of custom stop strings for Palm API

This commit is contained in:
Cohee 2023-09-25 23:12:14 +03:00
parent 3e29d39f05
commit 03e5ca054d
1 changed files with 2 additions and 1 deletions

View File

@ -1265,9 +1265,10 @@ async function sendOpenAIRequest(type, openai_msgs_tosend, signal) {
if (isPalm) {
const nameStopString = isImpersonate ? `\n${name2}:` : `\n${name1}:`;
const stopStringsLimit = 3; // 5 - 2 (nameStopString and new_chat_prompt)
generate_data['use_palm'] = true;
generate_data['top_k'] = Number(oai_settings.top_k_openai);
generate_data['stop'] = [nameStopString, oai_settings.new_chat_prompt, ...getCustomStoppingStrings()];
generate_data['stop'] = [nameStopString, oai_settings.new_chat_prompt, ...getCustomStoppingStrings(stopStringsLimit)];
}
if (isAI21) {