[Fix] Split if and only if complete eos string shows up (#477)

This commit is contained in:
Leymore 2023-10-13 06:52:20 -05:00 committed by GitHub
parent 861942ab1b
commit 7d9e386821
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -207,7 +207,7 @@ class OpenICLEvalTask(BaseTask):
if end_str: if end_str:
# TODO: Support calling tokenizer for the accurate eos token # TODO: Support calling tokenizer for the accurate eos token
# and avoid such hardcode # and avoid such hardcode
end_idx = s.find(end_str[:1], start) end_idx = s.find(end_str, start)
if end_idx != -1: if end_idx != -1:
end = end_idx end = end_idx