openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

Completion api injecting restart text after every prompt, no option to switch it off like in playground

Open drisme opened this issue 1 year ago • 1 comments

I'm not sure this is an issue with the python api per se. When using the completion api to generate the next line of a poem using davinci, the api always starts the text with "\n\n". This can't be filtered with the logit parameter as the phrase "\n\n" is actually 4 tokens according to the tokenizer: [59, 77, 59, 77]

What is the correct workaround? Is there any plan to add the option "Inject restart text" like in the playground? The restart text adds 4 tokens to each request, which adds up fast...

drisme avatar Jan 06 '23 12:01 drisme

Hi @drisme, thanks for writing in.

I'm not entirely sure I understand what the issue here is. Can you elaborate a bit more on the problem and the behavior you'd expect?

hallacy avatar Jan 06 '23 19:01 hallacy

I'm going to close this due to inactivity. Feel free to reopen.

hallacy avatar Jan 13 '23 17:01 hallacy