[Bugfix][HunyuanImage] fix accuracy in stream mode (#4265)
Signed-off-by: dengyunyang <584797741@qq.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
18e083e512
commit
14879d6619
2 files changed
+6
-1
No files matched your search
@@ -269,6 +269,10 @@ class OmniRequestState(RequestState):
|
||||
# tokens, so we always store a cumulative copy here.
|
||||
base_output.cumulative_token_ids = list(self.detokenizer.output_token_ids)
|
||||
|
||||
# Attach cumulative_text only at the final step for inter-stage use.
|
||||
if finish_reason is not None and hasattr(self.detokenizer, "output_text"):
|
||||
base_output.cumulative_text = self.detokenizer.output_text
|
||||
|
||||
if not hasattr(base_output, "multimodal_output"):
|
||||
setattr(base_output, "multimodal_output", {})
|
||||
if self.mm_accumulated:
|
||||
|
||||
@@ -185,7 +185,8 @@ def ar2diffusion(
|
||||
for i, ar_output in enumerate(ar_outputs):
|
||||
output = ar_output.outputs[0]
|
||||
generated_token_ids = output.cumulative_token_ids
|
||||
generated_text = getattr(output, "text", "") or ""
|
||||
# Prefer cumulative_text, fallback to text if aggregation dropped it
|
||||
generated_text = getattr(output, "cumulative_text", None) or getattr(output, "text", "") or ""
|
||||
|
||||
# Get original prompt info
|
||||
original_prompt = prompt[i] if i < len(prompt) else {}
|
||||
|
||||
Reference in new issue
Block a user