mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-11 11:51:53 +08:00
Develop (#11)
* 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:
@@ -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("> ")
|
||||
|
||||
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user