* adds saving and loading

* fixed some cmd issues

* fixed some cmd issues

* fixed capitalization issue

* smallupdate

* update

* update

* dev changes

* more testing

* more dev fixes

* dragon story

* dragon story

* adding ai dm mode

* dm fix

* dm

* dm

* Gcloudstoragestuff

* fixed loading issues

* upped memory
This commit is contained in:
Nick Walton
2019-12-02 07:41:48 -07:00
committed by GitHub
parent a71d7d3da0
commit c63f7e051a
3 changed files with 8 additions and 7 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ def play_aidungeon_2():
story_manager.start_new_story(prompt, context=context, upload_story=upload_story)
print("\n")
console_print(context + str(story_manager.story))
console_print(str(story_manager.story))
while True:
tcflush(sys.stdin, TCIFLUSH)
action = input("> ")
+1 -1
View File
@@ -28,7 +28,7 @@ class Story():
if game_state is None:
game_state = dict()
self.game_state = game_state
self.memory = 8
self.memory = 20
def __del__(self):
if self.upload_story:
+6 -5
View File
@@ -96,17 +96,18 @@ def cut_trailing_action(text):
def cut_trailing_sentence(text):
text = standardize_punctuation(text)
last_punc = max(text.rfind('.'), text.rfind("!"), text.rfind("?"))
if last_punc <= 0:
last_punc = len(text)-1
et_token = text.rfind("<|endoftext|>")
if et_token != -1:
if et_token > 0:
last_punc = min(last_punc, et_token-1)
act_token = text.find(">")
if act_token != -1:
if act_token > 0:
last_punc = min(last_punc, act_token-1)
if last_punc > 0:
text = text[0:last_punc+1]
text = text[:last_punc+1]
text = cut_trailing_quotes(text)
text = cut_trailing_action(text)