mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-09 11:13:26 +08:00
update
This commit is contained in:
@@ -147,7 +147,8 @@ class CTRLGenerator():
|
||||
# Disallow used verbs
|
||||
if "used_verbs" in options:
|
||||
for verb in options["used_verbs"]:
|
||||
probabilities[self.word2idx[verb]] = -1e8
|
||||
if verb in self.word2idx:
|
||||
probabilities[self.word2idx[verb]] = -1e8
|
||||
|
||||
return probabilities
|
||||
|
||||
@@ -156,6 +157,9 @@ class CTRLGenerator():
|
||||
if options is None:
|
||||
options = {}
|
||||
|
||||
if prompt[-2:] == ".I":
|
||||
prompt = prompt[:-1] + " I"
|
||||
|
||||
if prompt[-1] != " ":
|
||||
prompt = prompt + " "
|
||||
first_token = True
|
||||
@@ -182,7 +186,7 @@ class CTRLGenerator():
|
||||
padded_text = text + [0] * (total_text_len - len(text))
|
||||
tokens_generated = np.tile(padded_text, (1, 1))
|
||||
result = ""
|
||||
max_new_lines = 5
|
||||
max_new_lines = 0
|
||||
num_new_lines = 0
|
||||
for token in range(len(text) - 1, total_text_len - 1):
|
||||
|
||||
|
||||
+3
-1
@@ -143,7 +143,9 @@ def second_to_first_person(text):
|
||||
return capitalize_first_letters(text)
|
||||
|
||||
|
||||
possible_verbs = ["ask", "go", "run", "open", "look", "walk", "make", "try", "say", "tell", "attack", "use", "turn", "fight", "scream", "yell"]
|
||||
possible_verbs = ["get", "take", "put", "give","set", "keep", "help", "show", "pay", "read", "start", "stay", "call",
|
||||
"change", "ask", "go", "run", "open", "look", "walk", "make", "try", "say", "tell", "attack", "use",
|
||||
"turn", "fight", "scream", "yell"]
|
||||
|
||||
def get_possible_verbs():
|
||||
return possible_verbs
|
||||
Reference in New Issue
Block a user