Fix sending empty array as OAI stop strings

This commit is contained in:
Cohee 2023-08-27 13:17:20 +03:00
parent 57985eb08e
commit 8cb194da0f
1 changed files with 1 additions and 1 deletions

View File

@ -3515,7 +3515,7 @@ app.post("/generate_openai", jsonParser, function (request, response_generate_op
}
// Add custom stop sequences
if (Array.isArray(request.body.stop)) {
if (Array.isArray(request.body.stop) && request.body.stop.length > 0) {
bodyParams['stop'] = request.body.stop;
}