LLM: fix inconsistency between output token number and max_new_token (#8479)
This commit is contained in:
parent
bcc1eae322
commit
d489775d2c
1 changed files with 1 additions and 1 deletions
|
|
@ -164,7 +164,7 @@ class GenerationMixin:
|
||||||
res_list = []
|
res_list = []
|
||||||
word_count = 0
|
word_count = 0
|
||||||
for token in tokens:
|
for token in tokens:
|
||||||
if word_count > max_new_tokens:
|
if word_count >= max_new_tokens:
|
||||||
break
|
break
|
||||||
res_list.append(token)
|
res_list.append(token)
|
||||||
word_count += 1
|
word_count += 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue