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
cc406da4
Unverified
Commit
cc406da4
authored
Jan 06, 2022
by
Yih-Dar
Committed by
GitHub
Jan 06, 2022
Browse files
[VisionTextDualEncoder] Fix doc example
Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
b67f345d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/vision_text_dual_encoder/modeling_vision_text_dual_encoder.py
...on_text_dual_encoder/modeling_vision_text_dual_encoder.py
+1
-1
No files found.
src/transformers/models/vision_text_dual_encoder/modeling_vision_text_dual_encoder.py
View file @
cc406da4
...
@@ -341,7 +341,7 @@ class VisionTextDualEncoderModel(PreTrainedModel):
...
@@ -341,7 +341,7 @@ class VisionTextDualEncoderModel(PreTrainedModel):
... pixel_values=inputs.pixel_values,
... pixel_values=inputs.pixel_values,
... return_loss=True,
... return_loss=True,
... )
... )
>>> loss, logits_per_image = outputs.loss, outputs.logits_per_imag # this is the image-text similarity score
>>> loss, logits_per_image = outputs.loss, outputs.logits_per_imag
e
# this is the image-text similarity score
>>> # save and load from pretrained
>>> # save and load from pretrained
>>> model.save_pretrained("vit-bert")
>>> model.save_pretrained("vit-bert")
...
...
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