[Refactor][OutputProcessor 2/8]: OmniRequestOutput should inherit RequestOutput and no nested wrap-up (#5146)
Signed-off-by: Boao Shi <aoibosh@connect.hku.hk> Signed-off-by: bowieshi <aoibosh@connect.hku.hk> Signed-off-by: princepride <wangzhipeng628@gmail.com> Signed-off-by: R2-Y <ruiruyang2@gmail.com> Signed-off-by: amy-why-3459 <wuhaiyan17@huawei.com> Signed-off-by: Shi Boao Bowie <aoibosh@connect.hku.hk> Co-authored-by: 汪志鹏 <wangzhipeng628@gmail.com> Co-authored-by: ruirui(rein) yang <73573651+R2-Y@users.noreply.github.com> Co-authored-by: amy-why-3459 <wuhaiyan17@huawei.com> Co-authored-by: Gao Han <hgaoaf@connect.ust.hk> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
89 files changed
+944
-639
No files matched your search
+19
-1
@@ -26,10 +26,28 @@ from PIL import Image
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
_synthetic_media_fallback_dir: Path | None = None
|
||||
|
||||
|
||||
def _resolve_synthetic_media_cache_dir(cache_dir: Path | str | None) -> Path:
|
||||
if cache_dir is not None:
|
||||
return Path(cache_dir).expanduser().resolve()
|
||||
return Path(tempfile.gettempdir()) / "vllm_omni_test_synthetic_media"
|
||||
|
||||
default = Path(tempfile.gettempdir()) / "vllm_omni_test_synthetic_media"
|
||||
try:
|
||||
default.mkdir(parents=True, exist_ok=True)
|
||||
# Verify write access: the directory may exist but belong to
|
||||
# another user (e.g. a previous CI job), causing PermissionError
|
||||
# later when individual files are saved.
|
||||
canary = default / ".write_test"
|
||||
canary.touch()
|
||||
canary.unlink()
|
||||
return default
|
||||
except (PermissionError, OSError):
|
||||
global _synthetic_media_fallback_dir
|
||||
if _synthetic_media_fallback_dir is None:
|
||||
_synthetic_media_fallback_dir = Path(tempfile.mkdtemp(prefix="vllm_omni_test_synthetic_media_"))
|
||||
return _synthetic_media_fallback_dir
|
||||
|
||||
|
||||
def _np_array_from_mp4_bytes(video_bytes: bytes) -> np.ndarray:
|
||||
|
||||
@@ -2938,9 +2938,9 @@ class OmniRunnerHandler:
|
||||
audio_content = None
|
||||
for stage_output in outputs:
|
||||
if getattr(stage_output, "final_output_type", None) == "text":
|
||||
text_content = stage_output.request_output.outputs[0].text
|
||||
text_content = stage_output.outputs[0].text
|
||||
if getattr(stage_output, "final_output_type", None) == "audio":
|
||||
audio_content = stage_output.request_output.outputs[0].multimodal_output["audio"]
|
||||
audio_content = stage_output.outputs[0].multimodal_output["audio"]
|
||||
result.audio_content = audio_content
|
||||
result.text_content = text_content
|
||||
result.success = True
|
||||
@@ -3080,7 +3080,7 @@ class OmniRunnerHandler:
|
||||
mm_out: dict[str, Any] | None = None
|
||||
for stage_out in outputs:
|
||||
if getattr(stage_out, "final_output_type", None) == "audio":
|
||||
mm_out = stage_out.request_output.outputs[0].multimodal_output
|
||||
mm_out = stage_out.outputs[0].multimodal_output
|
||||
break
|
||||
if mm_out is None:
|
||||
raise AssertionError("No audio output from pipeline")
|
||||
|
||||
Reference in new issue
Block a user