diff --git a/public/index.html b/public/index.html index 7ccf005dc..311b413f0 100644 --- a/public/index.html +++ b/public/index.html @@ -2800,6 +2800,8 @@ + + diff --git a/public/scripts/extensions/caption/settings.html b/public/scripts/extensions/caption/settings.html index d9cfc7215..f0e0ca4eb 100644 --- a/public/scripts/extensions/caption/settings.html +++ b/public/scripts/extensions/caption/settings.html @@ -46,6 +46,8 @@ + + diff --git a/public/scripts/openai.js b/public/scripts/openai.js index c698d7488..becc27fe6 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -1813,6 +1813,10 @@ async function sendOpenAIRequest(type, messages, signal) { biasCache = logit_bias; } + if (Object.keys(logit_bias).length === 0) { + logit_bias = undefined; + } + if (isScale && oai_settings.use_alt_scale) { return sendAltScaleRequest(messages, logit_bias, signal, type); } diff --git a/src/endpoints/backends/chat-completions.js b/src/endpoints/backends/chat-completions.js index f32d6babd..1e6cfe251 100644 --- a/src/endpoints/backends/chat-completions.js +++ b/src/endpoints/backends/chat-completions.js @@ -1046,20 +1046,9 @@ router.post('/generate', jsonParser, function (request, response) { const responseText = await errorResponse.text(); const errorData = tryParse(responseText); - const statusMessages = { - 400: 'Bad request', - 401: 'Unauthorized', - 402: 'Credit limit reached', - 403: 'Forbidden', - 404: 'Not found', - 429: 'Too many requests', - 451: 'Unavailable for legal reasons', - 502: 'Bad gateway', - }; - - const message = errorData?.error?.message || statusMessages[errorResponse.status] || 'Unknown error occurred'; + const message = errorResponse.statusText || 'Unknown error occurred'; const quota_error = errorResponse.status === 429 && errorData?.error?.type === 'insufficient_quota'; - console.log(message); + console.log(message, responseText); if (!response.headersSent) { response.send({ error: { message }, quota_error: quota_error });