From 5c74a923fff4df76f9c08f9afd73a711c5379673 Mon Sep 17 00:00:00 2001 From: wassname Date: Wed, 25 Dec 2019 07:38:10 +0800 Subject: [PATCH] rearrange for quick dev --- play.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/play.py b/play.py index a8d0f40..9962730 100644 --- a/play.py +++ b/play.py @@ -109,8 +109,7 @@ class AIPlayer: return clean_suggested_action(result_raw, min_length=settings.getint('action-min-length')) -def play(): - generator = getGenerator() +def play(generator): story_manager = UnconstrainedStoryManager(generator) ai_player = AIPlayer(generator) print("\n") @@ -317,5 +316,8 @@ def play(): colPrint("Sorry about that...where were we?", colors["query"]) colPrint(result, colors["ai-text"]) -#TODO: there's no reason for this to be enclosed in a function -play() + +# This is here for rapid development, without reloading the model. You import play into a jupyternotebook with autoreload +if __name__ == "__main__": + generator = getGenerator() + play(generator)