Skip to content
Snippets Groups Projects
Unverified Commit f93fd8e0 authored by Cornelius's avatar Cornelius Committed by GitHub
Browse files

Fix generation not concluding when eos was hit for each prompt

parent 337e3db6
No related branches found
No related tags found
No related merge requests found
......@@ -112,7 +112,7 @@ def generate(
next_token = sample(last_token_prelogits, temperature=temperature, top_p=0.8)
if eos_id is not None:
is_finished = is_finished ^ (next_token == eos_id).cpu()
is_finished = is_finished | (next_token == eos_id).cpu()
if is_finished.all():
break
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment