mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-11 11:51:53 +08:00
update
This commit is contained in:
@@ -157,8 +157,6 @@ class CTRLGenerator():
|
||||
if options is None:
|
||||
options = {}
|
||||
|
||||
prompt = prompt.replace(".I", ". I")
|
||||
|
||||
if prompt[-1] != " ":
|
||||
prompt = prompt + " "
|
||||
first_token = True
|
||||
|
||||
@@ -68,7 +68,7 @@ class StoryManager():
|
||||
def start_new_story(self, story_prompt):
|
||||
block = self.generator.generate(story_prompt)
|
||||
block = cut_trailing_sentence(block)
|
||||
block = story_replace(block)
|
||||
block = text_replace(block)
|
||||
story_start = story_prompt + block
|
||||
self.story = Story(story_start)
|
||||
return story_start
|
||||
@@ -149,12 +149,11 @@ class ConstrainedStoryManager(StoryManager):
|
||||
if options is None:
|
||||
options = {}
|
||||
|
||||
action = phrase + " " + self.generator.generate(prompt + phrase, options)
|
||||
action = phrase + " " + self.generator.generate(prompt + " " + phrase, options)
|
||||
action_result = cut_trailing_sentence(action)
|
||||
actino_result = text_replace(action_result)
|
||||
|
||||
action, result = split_first_sentence(action_result)
|
||||
result = story_replace(action_result)
|
||||
action = action_replace(action)
|
||||
|
||||
return action, result
|
||||
|
||||
|
||||
+2
-10
@@ -33,21 +33,13 @@ def cut_trailing_quotes(text):
|
||||
return text[:final_ind]
|
||||
|
||||
|
||||
def all_replace(text):
|
||||
def text_replace(text):
|
||||
text = first_to_second_person(text)
|
||||
text = text.replace("#","")
|
||||
text = remove_profanity(text)
|
||||
|
||||
return text
|
||||
|
||||
|
||||
def action_replace(text):
|
||||
return all_replace(text)
|
||||
|
||||
|
||||
def story_replace(text):
|
||||
return all_replace(text)
|
||||
|
||||
|
||||
|
||||
def split_first_sentence(text):
|
||||
first_period = text.find('.')
|
||||
|
||||
Reference in New Issue
Block a user