Skip to content

Commit 3fd585d

Browse files
Merge pull request #214 from cornzz/main
Fix generation not concluding when eos was hit for each prompt
2 parents 337e3db + f93fd8e commit 3fd585d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mistral_inference/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def generate(
112112
next_token = sample(last_token_prelogits, temperature=temperature, top_p=0.8)
113113

114114
if eos_id is not None:
115-
is_finished = is_finished ^ (next_token == eos_id).cpu()
115+
is_finished = is_finished | (next_token == eos_id).cpu()
116116

117117
if is_finished.all():
118118
break

0 commit comments

Comments
 (0)