Skip to content

Commit

Permalink
Fix skip special tokens in lmi-dist (deepjavalibrary#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
xyang16 authored and KexinFeng committed Aug 16, 2023
1 parent 0865639 commit c3fd994
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ def _prefill_and_decode(self, new_batch):
is_last_token = generation.generated_text is not None
if not is_last_token:
req_ids.append(r.id)
r.set_next_token(generation.token_text, last_token=is_last_token)
r.set_next_token(
"" if generation.token_is_special else generation.token_text,
last_token=is_last_token)

# filter the requests that are stopped.
if self.cache:
Expand Down

0 comments on commit c3fd994

Please sign in to comment.