From f9e32f2bb2962d920fd5cd3e86656b32f12d8f7f Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Sun, 6 Oct 2024 12:47:32 -0400 Subject: [PATCH] clip device fix (#6924) --- extra/models/clip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/models/clip.py b/extra/models/clip.py index 96ec072aa1..7b176fcdf3 100644 --- a/extra/models/clip.py +++ b/extra/models/clip.py @@ -440,7 +440,7 @@ class OpenClipEncoder: top = (h - SIZE) // 2 image = image.crop((0, SIZE, top, top+SIZE)) - x = Tensor(np.array(image.convert('RGB'))) + x = Tensor(np.array(image.convert('RGB')), device=self.std.device) x = x.permute(2, 0, 1).cast(dtypes.float32) / 255.0 return (x - self.mean) / self.std