Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
66b15efb
Unverified
Commit
66b15efb
authored
Apr 14, 2023
by
Joao Gante
Committed by
GitHub
Apr 14, 2023
Browse files
Pix2struct: doctest fix (#22761)
parent
390e121f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/models/pix2struct/modeling_pix2struct.py
src/transformers/models/pix2struct/modeling_pix2struct.py
+2
-2
No files found.
src/transformers/models/pix2struct/modeling_pix2struct.py
View file @
66b15efb
...
...
@@ -1700,8 +1700,8 @@ class Pix2StructForConditionalGeneration(Pix2StructPreTrainedModel):
>>> # forward pass
>>> outputs = model(**inputs, labels=labels)
>>> loss = outputs.loss
>>> print(loss.item())
5.2397
29881286621
>>> print(
f"{
loss.item()
:.5f}"
)
5.2397
3
```"""
use_cache
=
use_cache
if
use_cache
is
not
None
else
self
.
config
.
text_config
.
use_cache
return_dict
=
return_dict
if
return_dict
is
not
None
else
self
.
config
.
use_return_dict
...
...
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