From cf7b98b8077e91a40145986299c6d16f6dce2204 Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Tue, 15 Nov 2022 15:45:21 +0100 Subject: [PATCH] Fix `run_clip.py` (#20234) Co-authored-by: ydshieh --- examples/pytorch/contrastive-image-text/run_clip.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/pytorch/contrastive-image-text/run_clip.py b/examples/pytorch/contrastive-image-text/run_clip.py index 95d00de7ac..b83e530066 100644 --- a/examples/pytorch/contrastive-image-text/run_clip.py +++ b/examples/pytorch/contrastive-image-text/run_clip.py @@ -198,7 +198,8 @@ class Transform(torch.nn.Module): Normalize(mean, std), ) - def forward(self, x: Image) -> torch.Tensor: + def forward(self, x) -> torch.Tensor: + """`x` should be an instance of `PIL.Image.Image`""" with torch.no_grad(): x = self.transforms(x) return x