mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-09 11:13:26 +08:00
update
This commit is contained in:
@@ -20,6 +20,7 @@ def console_print(str):
|
||||
|
||||
def play_unconstrained():
|
||||
generator = CTRLGenerator()
|
||||
#generator = WebGenerator(CRED_FILE)
|
||||
story_manager = UnconstrainedStoryManager(generator, prompt)
|
||||
|
||||
console_print(str(story_manager.story))
|
||||
|
||||
@@ -254,8 +254,6 @@ class CTRLGenerator():
|
||||
tokens_generated_so_far = re.sub('(@@ )', '', string=tokens_generated_so_far)
|
||||
tokens_generated_so_far = re.sub('(@@ ?$)', '', string=tokens_generated_so_far)
|
||||
|
||||
print(tokens_generated_so_far)
|
||||
|
||||
result = tokens_generated_so_far[prompt_length:]
|
||||
|
||||
return result
|
||||
|
||||
@@ -29,7 +29,7 @@ class Story():
|
||||
if len(self.results) > 0:
|
||||
return self.results[-1]
|
||||
else:
|
||||
return ""
|
||||
return self.story_start
|
||||
|
||||
def __str__(self):
|
||||
story_list = [self.story_start]
|
||||
@@ -71,6 +71,7 @@ class UnconstrainedStoryManager(StoryManager):
|
||||
return result
|
||||
|
||||
def generate_result(self, action):
|
||||
print("Story context is ", self.story_context())
|
||||
block = self.generator.generate(self.story_context() + action)
|
||||
block = cut_trailing_sentence(block)
|
||||
block = story_replace(block)
|
||||
|
||||
Reference in New Issue
Block a user