remove endoftext etc

This commit is contained in:
wassname
2019-12-25 06:39:20 +08:00
parent d1baf4cada
commit 69d1151e86
+1 -1
View File
@@ -202,7 +202,7 @@ class GPT2Generator:
out = out[:, len(context_tokens) :].tolist()
for o in out:
generated += 1
text = self.tokenizer.decode(o, clean_up_tokenization_spaces=True)
text = self.tokenizer.decode(o, clean_up_tokenization_spaces=True, skip_special_tokens=True)
if self.stop_token:
index = text.find(self.stop_token)
if index == -1: