Make sure max_tokens is always integer.

This commit is contained in:
Webifi 2023-06-19 15:33:47 -05:00
parent 6ff9585d6a
commit d8c797e619
1 changed files with 1 additions and 0 deletions

View File

@ -166,6 +166,7 @@ export class ChatRequest {
if (key === 'max_tokens') { if (key === 'max_tokens') {
if (opts.maxTokens) value = opts.maxTokens // only as large as requested if (opts.maxTokens) value = opts.maxTokens // only as large as requested
if (value > maxAllowed || value < 1) value = null // if over max model, do not define max if (value > maxAllowed || value < 1) value = null // if over max model, do not define max
if (value) value = Math.floor(value)
} }
if (key === 'n') { if (key === 'n') {
if (opts.streaming || opts.summaryRequest) { if (opts.streaming || opts.summaryRequest) {