Prompt fix for empty intermediate steps in summarization #660
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding quotation marks around {text} avoids generating empty or completely random responses from OpenAI davinci-003. Empty or completely unrelated intermediate responses in summarization messes up the final result or makes it very inaccurate.
The error from OpenAI would be: "The model predicted a completion that begins with a stop sequence, resulting in no output. Consider adjusting your prompt or stop sequences."
This fix corrects the prompting for summarization chain. This works on API too, the images are for demonstrative purposes.
This approach can be applied to other similar prompts too.
Examples:
Without quotation marks
![Screenshot from 2023-01-20 07-18-19](https://user-images.githubusercontent.com/22897470/213624365-9dfc18f9-5f3f-45d2-abe1-56de67397e22.png)
With quotation marks
![Screenshot from 2023-01-20 07-18-35](https://user-images.githubusercontent.com/22897470/213624478-c958e742-a4a7-46fe-a163-eca6326d9dae.png)