This commit is contained in:
bwt09
2022-06-15 11:12:32 -07:00
parent 7019fdb0eb
commit ecab2b467d

View File

@@ -90,7 +90,8 @@ class LanguageModelWrapper:
# processing -ing, -s, etc.
ent_in_sent = prompt[prompt.find(f'<ENT{ent_idx}>'):].split()[0]
for punc in string.punctuation:
ent_in_sent = ent_in_sent.split(punc)[0]
if punc not in '<>':
ent_in_sent = ent_in_sent.split(punc)[0]
ent_in_sent = ent_in_sent.replace(f'<ENT{ent_idx}>', ent)
ent_token_ids = self.tokenizer.encode(