njerschow/openai-api

Can not increase output number "n"

Closed this issue · 2 comments

davut commented

Problem with multiple outputs,

When "n" is 1, everything works correctly but when I increase n, it gives 500 error
"Rejection: SyntaxError: The string did not match the expected pattern."

davut commented

Example:

This works okay

const gptResponse = await openai.complete({
        engine: 'davinci-instruct-beta',
        prompt: prompt,
        maxTokens: 500,
        temperature: 0.7,
        topP: 1,
        presencePenalty: 0,
        frequencyPenalty: 0.5,
        bestOf: 1,
        n: 1,
        stop: ['"""']
    });

However this does not

const gptResponse = await openai.complete({
        engine: 'davinci-instruct-beta',
        prompt: prompt,
        maxTokens: 500,
        temperature: 0.7,
        topP: 1,
        presencePenalty: 0,
        frequencyPenalty: 0.5,
        bestOf: 1,
        n: 10,
        stop: ['"""']
    });
davut commented

Okay, removing bestOf solved the issue, thanks