mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-09 11:13:26 +08:00
update
This commit is contained in:
+2
-1
@@ -29,8 +29,9 @@ def play_unconstrained():
|
||||
|
||||
console_print(str(story_manager.story))
|
||||
while (True):
|
||||
print("\n")
|
||||
action = input("> ")
|
||||
action = "You " + action
|
||||
action = " You " + action + "."
|
||||
result = story_manager.act(action)
|
||||
console_print(action + result)
|
||||
|
||||
|
||||
@@ -256,6 +256,8 @@ class CTRLGenerator():
|
||||
# os.system("clear")
|
||||
|
||||
tokens_generated_so_far = ' '.join([self.idx2word[c] for c in tokens_generated[0].squeeze()[:token + 2]])
|
||||
tokens_generated_so_far = re.sub('(@@ )', '', string=tokens_generated_so_far)
|
||||
tokens_generated_so_far = re.sub('(@@ ?$)', '', string=tokens_generated_so_far)
|
||||
|
||||
result = tokens_generated_so_far[prompt_length:]
|
||||
|
||||
|
||||
@@ -61,16 +61,21 @@ def replace_outside_quotes(text, current_word, repl_word):
|
||||
|
||||
|
||||
first_to_second_mappings = [
|
||||
("I'm", "you're"),
|
||||
("I am", "you are"),
|
||||
("I ", "you "),
|
||||
("I've", "You've"),
|
||||
("my", "your"),
|
||||
("My", "Your"),
|
||||
("we ","you "),
|
||||
("We ","You "),
|
||||
(" mine"," yours"),
|
||||
("me", "you"),
|
||||
]
|
||||
|
||||
second_to_first_mappings = [
|
||||
("You're", "I'm"),
|
||||
("you're", "I'm"),
|
||||
("Your", "My"),
|
||||
("your", "my"),
|
||||
("you are", "I am"),
|
||||
|
||||
Reference in New Issue
Block a user