[Frontend] Add omni benchmark support for image and video endpoints (#4728)
This commit is contained in:
1 parent
e1c59edec6
commit
b1ec136bd7
21 files changed
+1626
-72
No files matched your search
@@ -739,10 +739,16 @@ class StagePool:
|
||||
def _infer_output_unit_type(self, request_outputs: list[Any], *, token_count: int) -> str:
|
||||
final_output_type = getattr(self.stage_client, "final_output_type", None)
|
||||
|
||||
if self._has_image_output(request_outputs) or final_output_type in {"image", "images"}:
|
||||
return "image"
|
||||
if self._has_video_output(request_outputs) or final_output_type in {"video", "videos"}:
|
||||
# Prefer declared modality over payload heuristics: video diffusion often
|
||||
# stores frames in ``images`` (see serving_video / output_formatter).
|
||||
if final_output_type in {"video", "videos"}:
|
||||
return "video"
|
||||
if final_output_type in {"image", "images"}:
|
||||
return "image"
|
||||
if self._has_video_output(request_outputs):
|
||||
return "video"
|
||||
if self._has_image_output(request_outputs):
|
||||
return "image"
|
||||
if self._has_audio_output(request_outputs) or final_output_type == "audio":
|
||||
return "audio"
|
||||
if self._has_trajectory_latent_output(request_outputs) or self._has_latent_output(request_outputs):
|
||||
@@ -778,6 +784,10 @@ class StagePool:
|
||||
total_videos = sum(self._count_videos(ro) for ro in request_outputs)
|
||||
if total_videos > 0:
|
||||
return total_videos
|
||||
# Video payloads are commonly carried on ``images`` for diffusion.
|
||||
total_images = sum(self._count_images(ro) for ro in request_outputs)
|
||||
if total_images > 0:
|
||||
return total_images
|
||||
if unit_type == "latent":
|
||||
total_latents = sum(
|
||||
self._count_value_units(getattr(ro, "trajectory_latents", None))
|
||||
|
||||
Reference in new issue
Block a user