Have any of you come across an API call where it returned empty text for no reason even though the call was successful? I have tried running the same prompt on the playground and it worked all the time. But when calling via API, it sometimes returns the empty text for no apparent reason. It seems to be happening on the Devinci-instruct engine only.
This is the output
For the same prompt and input:
When it works, this is what I get
1)
“{“id”: “cmpl-3Uo7BvodaapzDUUZzERRnDV1xV9Gd”, “object”: “text_completion”, “created”: 1628471493, “model”: “if-davinci-v2”, “choices”: [**{“text”: " chocolate, customise, deliver**”, “index”: 0, “logprobs”: null, “finish_reason”: “stop”}]}\n"
When it does not work, this is what I get.
1)
“{“id”: “cmpl-3UoBCqMrl2aUwPOxpzR7QODk6xYcV”, “object”: “text_completion”, “created”: 1628471742, “model”: “if-davinci-v2”, “choices”: [{“text”: “”, “index”: 0, “logprobs”: null, “finish_reason”: “stop”}]}\n”
Hi @m-a.schenk, that is really interesting. You are right. I have changed the stop sequence to something else i.e. “###” and now it is fine. Thanks
Thanks for your suggestion M A Schenk, I am looking at handling the “empty text” exception as well as playing around with logprobs as you suggested and observing the output. Hopefully, get some permanent fix or at least I will learn something new