Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions torchchat/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,8 @@ def callback(x, *, done_generating=False):
max_seq_length=max_seq_length,
attention_backend=self.builder_args.attention_backend,
)
if generator_args.chat_mode:
start_pos += encoded.size(0)
for token_tensor, metrics in generator_func:
if token_tensor is not None:
start_pos += token_tensor.size(0)
Expand Down
Loading