Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Incorrect detection of generation failure leads to infinite loop #65

Open
timmaclean opened this issue Oct 27, 2024 · 1 comment

Comments

@timmaclean
Copy link
Contributor

I was encountering an infinite loop of empty AI responses halfway through the generation process, seemingly at random.

While debugging, I identified that the code to handle a generation failure ( Writer/Interface/Wrapper.py:388 ) does not correctly handle a message with no content, resulting in an infinite loop of empty response generation. Using a breakpoint to add spaces before the test, the infinite loop was broken.

(I assume my specific configuration resulted in generation failures with no white-space, while this was tested with a configuration that did generate white-space even when it failed)

if _Messages[-1]["content"].isspace():

I recommend the line be changed to the following:

if _Messages[-1]["content"].trim() == "":
@datacrystals
Copy link
Owner

Thank you! Would you mind making that into a PR? I'd be happy to merge it!

timmaclean added a commit to timmaclean/AIStoryWriter that referenced this issue Oct 30, 2024
Resolves issue datacrystals#65 "[BUG] Incorrect detection of generation failure leads to infinite loop"

datacrystals#65 (comment)
timmaclean added a commit to timmaclean/AIStoryWriter that referenced this issue Oct 30, 2024
Related to issue datacrystals#65 "[BUG] Incorrect detection of generation failure leads to infinite loop"
timmaclean added a commit to timmaclean/AIStoryWriter that referenced this issue Oct 30, 2024
Fixes issue datacrystals#65 as well as other similar lines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants