#Codex API returning finish_reason=null

17 messages · Page 1 of 1 (latest)

winter pond
#

(I asked this question on the OpenAI forum, but I'm not sure if this is a better place to ask. Happy to remove one of the posts to avoid duplication!)

Sample py code:

openai.Completion.create(
    model='code-davinci-002',
    prompt=['<|start|>1<|end|><|start|>2<|end|><|start|>'],
    max_tokens=10,
    stop=['<|end|>'],
    temperature=0
)

Around 20-30% of the time, it returns:

"choices": [
    {
      "finish_reason": null,
      "index": 0,
      "logprobs": null,
      "text": "3"
    }
  ]

Otherwise, it returns expected result:

"choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "logprobs": null,
      "text": "3"
    }
  ]

In some cases, for longer prompts, it fails ~100% of the time.

If start/end tags are changed from <|this|> to <this>, the problem never happens.

Any ideas why this might be the case? It seems like it started occurring today, since some older prompts I have which I know were working correctly just a couple of days ago, do not work anymore.

sick shuttle
#

Same problem

winter pond
#

According to the discussion on the forum, seems like only array-prompts are affected, in case it helps anyone before the real issue is solved.
https://community.openai.com/t/codex-api-returning-finish-reason-null/78028/4

OpenAI API Community Forum

I see, sorry I missed it Expected result: 3 Are these all the prompt params you are using? model='code-davinci-002', prompt=['<|start|>1<|end|><|start|>2<|end|><|start|>'], max_tokens=10, stop=['<|end|>'], temperature=0

humble fox
#

Thanks for sharing @winter pond!

winter pond
#

No problem! Is there some ticket I can follow on this, to get notified when the problem is fixed?

humble fox
#

Unfortunately no, not right now

sick shuttle
#

@winter pond Not sure what you mean by array-prompt, but "Say this is a test" prompt failed

winter pond
#

You can use the API to send multiple prompts in one request, like this:

openai.Completion.create(
    model='code-davinci-002',
    prompt=["First prompt", "Second prompt", "Third prompt"],
)

But if you only send a single prompt, e.g.

openai.Completion.create(
    model='code-davinci-002',
    prompt="Single prompt",
)

then the error never seems to occur.

sick shuttle
#

This is my body

#

{
"model": "text-davinci-003",
"prompt": "Say this is a test",
"max_tokens": 10,
"temperature": 0
}

#

== null

winter pond
#

Oh, then I guess the problem is more severe now... These prompts worked fine yesterday :/

sick shuttle
#

But this command was made yesterday

#

It never (since sunday) really worked for me

winter pond
#

I see, then I guess I either just got lucky (and the person in the Forum as well), or we are not always accessing the same endpoint and the error is not on all of them.

sick shuttle
#

I guess so, I also find it to be less common today (100/300 error on mon), (33/300) today

#

so maybe they are working on a fix? but thanks for helping tho