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

View File

@@ -3515,7 +3515,7 @@ app.post("/generate_openai", jsonParser, function (request, response_generate_op
} }
// Add custom stop sequences // 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; bodyParams['stop'] = request.body.stop;
} }