clip device fix (#6924)

This commit is contained in:
Tobias Fischer
2024-10-07 00:47:32 +08:00
committed by GitHub
parent 01a2d7316d
commit f9e32f2bb2
+1 -1
View File
@@ -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