Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
cf7b98b8
Unverified
Commit
cf7b98b8
authored
Nov 15, 2022
by
Yih-Dar
Committed by
GitHub
Nov 15, 2022
Browse files
Fix `run_clip.py` (#20234)
Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
683cbc4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
examples/pytorch/contrastive-image-text/run_clip.py
examples/pytorch/contrastive-image-text/run_clip.py
+2
-1
No files found.
examples/pytorch/contrastive-image-text/run_clip.py
View file @
cf7b98b8
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment