[Text completion] Generating text get stopped although limit not hit

Hi, I’m using text-davinci-003 to generate bed-time story. It stops generating although the total prompts haven’t hit the limit 4096 yet. How do I get it reach the intended length of around 3,500 words

My input (python) file:

{…
prompt="ChatGPT is playing the role of a thriller writer, it will draft a complete story, which contains around 3,500 words, depending on the topic human input to it
\n\n Human: please write a story about a missing jigsaw puzzle
\n\n ChatGPT:
"

}

The returned result is something like this:
{
“choices”: [
{
“finish_reason”: “stop”,
“index”: 0,
“logprobs”: null,
“text”: “…generated text…, I deleted for brevity”
}
],
“created”: 1677162535,
“id”: “cmpl-6n6sZ7G937POipvLzk7E5XSMWbJEe”,
“model”: “text-davinci-003”,
“object”: “text_completion”,
“usage”: {
“completion_tokens”: 449,
“prompt_tokens”: 57,
“total_tokens”: 506
}
}

You prompt isn’t clear enough for the model. There are conditionals, and vague and weak words like around 3500 words. You need to work on prompt engineering. Here’s some Best practices for prompt engineering with OpenAI API | OpenAI Help Center

Also what hyper params are you using like temperature, etc.?

1 Like