Unverified Commit 6897e06b authored by Liangsheng Yin's avatar Liangsheng Yin Committed by GitHub
Browse files

Remove repeatedly lists adding in `init_incremental_detokenization` (#10412)

parent a360511d
......@@ -692,9 +692,15 @@ class Req:
self.surr_offset = max(
self.read_offset - INIT_INCREMENTAL_DETOKENIZATION_OFFSET, 0
)
self.surr_and_decode_ids = (
self.origin_input_ids_unpadded[self.surr_offset :] + self.output_ids
)
self.cur_decode_ids_len = len(self.output_ids)
else:
self.surr_and_decode_ids.extend(self.output_ids[self.cur_decode_ids_len :])
self.cur_decode_ids_len = len(self.output_ids)
all_ids = self.origin_input_ids_unpadded + self.output_ids
return all_ids[self.surr_offset :], self.read_offset - self.surr_offset
return self.surr_and_decode_ids, self.read_offset - self.surr_offset
def check_finished(self):
if self.finished():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment