Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions fastdeploy/entrypoints/openai/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,9 @@ class CompletionRequest(BaseModel):

collect_metrics: Optional[bool] = False

# NOTE(Wanglongzhi2001): temporary parameter for video understanding benchmark
video_fps: Optional[float] = None
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 建议 类型一致性问题:此处 video_fps 使用 float 类型,但下游处理器中均使用 int 类型。

例如:

  • ernie4_5_vl_processor/process.py:105: video_fps: int = 2
  • qwen_vl_processor/process.py:69: video_fps: int = FPS
  • qwen3_vl_processor/process.py:147: video_fps: int = FPS

虽然 Python 会自动转换,但建议保持类型一致以避免潜在问题:

video_fps: Optional[int] = None


Comment on lines 554 to +558
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

video_fps 被加在 collect_metrics 之后、且不在 doc: start/end-*-extra-params 标记区域内。该文件多处用这些 doc 标记维护“额外参数”分组;把新增字段放在标记外会让参数分组/自动文档生成(如果有)变得不一致,后续也更难维护。建议把 video_fps 放入对应的 extra-params 区块,并补充一句英文注释说明单位/含义(fps 的语义是采样 fps 还是原视频 fps)。

Copilot uses AI. Check for mistakes.
Comment on lines +556 to +558
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新增 video_fps 字段会改变对外请求协议,但当前仓库里已有针对 CompletionRequest/ChatCompletionRequest 的单测(例如 tests/entrypoints/openai/test_chatcompletion_request.py)。建议补一条覆盖:1) 该字段能被正常解析;2) to_dict_for_infer() 会按预期透传该字段;3) (若加入范围约束)非法值能被拒绝。否则后续重构协议/序列化时容易回归。

Copilot uses AI. Check for mistakes.
Comment on lines +556 to +558
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

从当前仓库代码来看,video_fps 仅在协议模型里新增了字段并会被 to_dict_for_infer() 透传,但在后续预处理/多模态处理链路中并没有任何地方读取 request['video_fps'](全仓搜索仅命中本文件与若干 data_processor 的初始化参数)。如果该参数期望影响视频抽帧,建议在构造/规范化 multimodal_data(或 mm item)时把 video_fps 映射为每个 video item 的 fps 默认值(例如当 item 未显式给 fps 时才填充),否则对外“支持 video_fps”可能只是接收字段但不生效。

Copilot uses AI. Check for mistakes.
def to_dict_for_infer(self, request_id=None, prompt=None):
"""
Convert the request parameters into a dictionary
Expand Down Expand Up @@ -739,6 +742,9 @@ class ChatCompletionRequest(BaseModel):

collect_metrics: Optional[bool] = False

# NOTE(Wanglongzhi2001): temporary parameter for video understanding benchmark
video_fps: Optional[float] = None

Comment on lines +745 to +747
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议补充单测覆盖 ChatCompletionRequest.video_fps 的解析与透传行为(以及若添加约束后的错误路径)。目前该模块在 tests/entrypoints/openai 下已有较完整覆盖,新增协议字段不加测试容易产生回归。

Copilot uses AI. Check for mistakes.
Comment on lines +745 to +747
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上:ChatCompletionRequest.video_fps 当前只会被解析/透传,但仓库内没有消费该字段来影响视频抽帧参数(未映射到 mm item 的 fps 等)。若 benchmark 依赖该参数生效,建议在请求预处理阶段把 video_fps 下沉到具体 video item 的抽帧参数里(保持 item 级参数优先),否则会出现“参数可传但实际不生效”的问题。

Copilot uses AI. Check for mistakes.
def to_dict_for_infer(self, request_id=None):
"""
Convert the request parameters into a dictionary
Expand Down
Loading