mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-10 11:40:48 +08:00
update
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ import textwrap
|
||||
CRED_FILE = "./AI-Adventure-2bb65e3a4e2f.json"
|
||||
|
||||
# Set the key
|
||||
def console_print(str, pycharm=True):
|
||||
def console_print(str, pycharm=False):
|
||||
if pycharm:
|
||||
LINE_WIDTH=80
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ class CTRLGenerator():
|
||||
prompt_logits[_token][generated_token] /= self.penalty
|
||||
|
||||
# disallow some tokens
|
||||
forbidden_tokens = ['<unk>', 'Sco@@', "&@@", "1]@@", "2]@@", "3]@@", "4]@@", "https://www.@@", "[@@"]
|
||||
forbidden_tokens = ['<unk>', 'Sco@@', "&@@", "1]@@", "2]@@", "3]@@", "4]@@", "https://www.@@", "[@@", ":@@"]
|
||||
|
||||
if num_new_lines > self.max_new_lines:
|
||||
forbidden_tokens.append("\n")
|
||||
|
||||
@@ -39,9 +39,9 @@ class Story():
|
||||
self.results.append(story_block)
|
||||
|
||||
def latest_result(self):
|
||||
if len(self.results) > 1:
|
||||
return self.actions[-2] + self.results[-2] + self.actions[-1] + self.results[-1]
|
||||
elif len(self.results) == 1:
|
||||
# if len(self.results) > 1:
|
||||
# return self.actions[-2] + self.results[-2] + self.actions[-1] + self.results[-1]
|
||||
if len(self.results) >= 1:
|
||||
return self.story_start + self.actions[-1] + self.results[-1]
|
||||
else:
|
||||
return self.story_start
|
||||
|
||||
+5
-3
@@ -114,16 +114,18 @@ first_to_second_mappings = [
|
||||
("me", "you"),
|
||||
("us", "you"),
|
||||
("our", "your"),
|
||||
("I'll", "you'll")
|
||||
("I'll", "you'll"),
|
||||
("myself", "yourself")
|
||||
]
|
||||
|
||||
second_to_first_mappings = [
|
||||
("you're", "I'm"),
|
||||
("your ", "my "),
|
||||
("your", "my "),
|
||||
("you are", "I am"),
|
||||
("you", "I"),
|
||||
("you", "me"),
|
||||
("you'll", "I'll")
|
||||
("you'll", "I'll"),
|
||||
("yourself", "myself")
|
||||
]
|
||||
|
||||
def capitalize_helper(string):
|
||||
|
||||
Reference in New Issue
Block a user