Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 0852578

Browse files
author
nlpfollower
committed
Add encoded size to start_pos
1 parent 654bb03 commit 0852578

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

torchchat/generate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,7 @@ def callback(x, *, done_generating=False):
11871187
skip_cache_setup=not is_first_sample,
11881188
max_seq_length=max_seq_length,
11891189
)
1190+
start_pos += encoded.size(0)
11901191
for token_tensor, metrics in generator_func:
11911192
if token_tensor is not None:
11921193
start_pos += token_tensor.size(0)

0 commit comments

Comments
 (0)