[BugFix]Fix keyError: num_processed_tokens_delta (#2213)

Signed-off-by: amy-why-3459 <wuhaiyan17@huawei.com>
This commit is contained in:
amy-why-3459 authored and GitHub committed 2026-03-26 15:16:25 +08:00
1 parent 8305477750
commit 029c85393a
2 files changed
+1 -127

No files matched your search

@@ -602,7 +602,6 @@ class Qwen3OmniMoeForConditionalGeneration(
dtype=torch.long,
)
update_dict["code_predictor_codes"] = code_predictor_codes
update_dict["num_processed_tokens_delta"] = span_len
else:
# decode
if not info_dict.get("decode_flag", False):
@@ -620,8 +619,7 @@ class Qwen3OmniMoeForConditionalGeneration(
)
update_dict["mtp_inputs"] = last_talker_hidden, text_step
processed_delta = update_dict.pop("num_processed_tokens_delta")
update_dict["num_processed_tokens"] = info_dict.get("num_processed_tokens", 0) + processed_delta
update_dict["num_processed_tokens"] = info_dict.get("num_processed_tokens", 0) + span_len
return input_ids, input_embeds, update_dict
def talker_mtp(
@@ -918,7 +916,6 @@ class Qwen3OmniMoeForConditionalGeneration(
start_index = info_dict.get("num_processed_tokens", 0)
thinker_output_token_ids = info_dict.get("thinker_output_token_ids", [])
if start_index >= len(thinker_output_token_ids) - 1:
update_dict["num_processed_tokens_delta"] = 0
if info_dict.get("finished_flag"):
return self.tts_pad_embed.to(device)
update_dict["finished_flag"] = True
@@ -937,7 +934,6 @@ class Qwen3OmniMoeForConditionalGeneration(
thinker_embed = thinker_embed.to(device)
update_dict["thinker_decode_embeddings"] = None
update_dict["num_processed_tokens_delta"] = 1
return self.talker.text_projection(thinker_embed).to(device)
def talker_preprocess_decode(