From 0cbec497c4686b0106a1eac8ea6310ca040a193e Mon Sep 17 00:00:00 2001 From: li-lizhe <147392333@qq.com> Date: Sat, 5 Sep 2026 09:25:46 +0800 Subject: [PATCH] Fix device-type comparison in SceneMetric: set device_map for any non-CPU device The Qwen2.5-Omni model was only passed a device_map when self.device.type == "cuda". On non-CUDA accelerators (Ascend NPU, Apple MPS, Intel XPU, AMD ROCm) the model silently loads on CPU, making the scene metric unusable on those devices. Use device.type != "cpu" instead, which correctly passes a device_map for every accelerator type. Fixes #1815 --- fastvideo/eval/metrics/vbench/scene/metric.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastvideo/eval/metrics/vbench/scene/metric.py b/fastvideo/eval/metrics/vbench/scene/metric.py index d8dc70354a..77c3fe4abb 100644 --- a/fastvideo/eval/metrics/vbench/scene/metric.py +++ b/fastvideo/eval/metrics/vbench/scene/metric.py @@ -63,7 +63,7 @@ def setup(self) -> None: self._model = Qwen2_5OmniForConditionalGeneration.from_pretrained( self._model_path, torch_dtype=torch.bfloat16, - device_map=str(self.device) if self.device.type == "cuda" else None, + device_map=str(self.device) if self.device.type != "cpu" else None, ) self._model.disable_talker() self._model.eval()