From eef85e4ff00aa269f22f099a23fc43929cecd8d8 Mon Sep 17 00:00:00 2001 From: yangjianfengo1 <125249383+yangjianfengo1@users.noreply.github.com> Date: Fri, 31 Oct 2025 14:08:23 +0800 Subject: [PATCH] [BugFix] update eb5 video chunk (#4705) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复视频和图片分chunk * 修复视频和图片分chunk * 修复视频和图片分chunk --- .../engine/sched/resource_manager_v1.py | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/fastdeploy/engine/sched/resource_manager_v1.py b/fastdeploy/engine/sched/resource_manager_v1.py index b9af5b071..fdff2c0ba 100644 --- a/fastdeploy/engine/sched/resource_manager_v1.py +++ b/fastdeploy/engine/sched/resource_manager_v1.py @@ -173,23 +173,6 @@ class ResourceManagerV1(ResourceManager): prompt_token_ids_len = len(request.prompt_token_ids) - if new_end_idx >= prompt_token_ids_len: - return num_new_tokens - - if inputs.get("can_split_idx_list") is not None: - if new_end_idx >= prompt_token_ids_len: - return num_new_tokens - patch_idx = inputs["patch_idx"][new_end_idx] - patch_map = inputs["patch_map"][patch_idx] - modal_id = patch_map["modal_id"] - if modal_id == IDS_TYPE_FLAG["text"]: - return num_new_tokens - elif modal_id == IDS_TYPE_FLAG["video"]: - can_split_idx_list = inputs["can_split_idx_list"] - for i in range(len(can_split_idx_list)): - if can_split_idx_list[i] >= new_end_idx: - return can_split_idx_list[i] - pre_end_idx - assert prompt_token_ids_len == len(inputs["patch_idx"]), (prompt_token_ids_len, len(inputs["patch_idx"])) # start @@ -215,8 +198,17 @@ class ResourceManagerV1(ResourceManager): end_patch_idx -= 1 end_patch_map = inputs["patch_map"][end_patch_idx] end_modal_id = end_patch_map["modal_id"] - if end_modal_id > 0: + + if end_modal_id > 0 and end_modal_id != IDS_TYPE_FLAG["video"]: new_end_idx = end_patch_map["end_idx"] # 当前模态结束位置 + + if end_modal_id == IDS_TYPE_FLAG["video"]: + can_split_idx_list = inputs["can_split_idx_list"] + for i in range(len(can_split_idx_list)): + if can_split_idx_list[i] >= new_end_idx: + new_end_idx = can_split_idx_list[i] + break + num_new_tokens = new_end_idx - pre_end_idx request.image_end = end_patch_map["image_num"]