From fe673953b1f8cfe2a2f1ed2ef7c3207fefc28f43 Mon Sep 17 00:00:00 2001 From: hysts Date: Sun, 19 Mar 2023 21:11:04 +0900 Subject: [PATCH] Fix device mismatch for text to video (#207) --- modelscope/models/multi_modal/video_synthesis/diffusion.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modelscope/models/multi_modal/video_synthesis/diffusion.py b/modelscope/models/multi_modal/video_synthesis/diffusion.py index 4eba1f13..138fddae 100644 --- a/modelscope/models/multi_modal/video_synthesis/diffusion.py +++ b/modelscope/models/multi_modal/video_synthesis/diffusion.py @@ -10,6 +10,7 @@ __all__ = ['GaussianDiffusion', 'beta_schedule'] def _i(tensor, t, x): r"""Index tensor using t and format the output according to x. """ + tensor = tensor.to(x.device) shape = (x.size(0), ) + (1, ) * (x.ndim - 1) return tensor[t].view(shape).to(x)