latitudegames / AIDungeon

Infinite adventures await!
http://www.aidungeon.io/
MIT License
3.19k stars 554 forks source link

[BUG] "Ask" as verb often causes the generator to run for a very long time #131

Closed ryvenn closed 4 years ago

ryvenn commented 4 years ago

Describe the bug Some verbs, like "ask," very frequently cause the generator to run forever without outputting text or giving control back to the user. This is frustrating because if you have to terminate the process in Windows (while running locally) it prevents the game from being saved.

To Reproduce Steps to reproduce the behavior: Unfortunately I don't have a save on hand in a situation where this is guaranteed, but here is an example from earlier: "ask the little girl who all these people are" results in the infinite loop. Reloading (I remembered to make a manual save before trying "ask" that time) at the same point and trying "make the little girl tell you who all these people are" works fine, as expected.

The problem seems worse in long-running games. In case it is relevant, note that I have self.memory = 15 in story_manager.py because 20 was causing 1024 token crashes (see issue #68).

Expected behavior Preferably it outputs something even if it's nonsense, or else it returns control to me and lets me input something else.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context

ryvenn commented 4 years ago

Perhaps it is not infinite but just really, really long - I left it running for about half an hour, and when I went back to it after typing this bug report it had finished. Typical commands take 1-2 minutes to resolve on my system and 3-4 I consider quite long, so for some reason "ask" may take 10 times longer.

kik4444 commented 4 years ago

Running it locally on Linux here. Sometimes the same happens to me too, though I've never left it for long enough to see if it produces an output

Arndress commented 4 years ago

According to a user on 4chan:

it tries to clear out "You ask/You say" lines from the last line in the response, but if it only has one line then it deletes all of it, and then generates another one (to presumably the same result, forever)

thadunge2 reports to have fixed this error in his fork here: https://github.com/thadunge2/AIDungeon/commit/b996a0bc464846923c61005d0d0cee3739e0058f

AZaitzeff commented 4 years ago

I find that any time I type in dialog (even without say/ask) it runs for longer than my other commands.

I was on my 15th command. I have self.memory = 8. I am running it on colab. "Why have you brought me here?" took 1 hour 30 min and still waiting.

Lowering self.memory might help the problem.