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

Commit e238a46

Browse files
author
nlpfollower
committed
Only in chat mode
1 parent 0852578 commit e238a46

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torchchat/generate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,8 @@ 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)
1190+
if generator_args.chat_mode:
1191+
start_pos += encoded.size(0)
11911192
for token_tensor, metrics in generator_func:
11921193
if token_tensor is not None:
11931194
start_pos += token_tensor.size(0)

0 commit comments

Comments
 (0)