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
6f041fcb
"...git@developer.sourcefind.cn:modelzoo/donut_pytorch.git" did not exist on "4cfcf972560e1a0f26eb3e294c8fc88a0d336626"
Unverified
Commit
6f041fcb
authored
Aug 21, 2023
by
mchau
Committed by
GitHub
Aug 21, 2023
Browse files
fix documentation for CustomTrainer (#25635)
fix doc
parent
8608bf20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
docs/source/en/main_classes/trainer.md
docs/source/en/main_classes/trainer.md
+1
-1
No files found.
docs/source/en/main_classes/trainer.md
View file @
6f041fcb
...
...
@@ -60,7 +60,7 @@ from transformers import Trainer
class
CustomTrainer
(
Trainer
):
def
compute_loss
(
self
,
model
,
inputs
,
return_outputs
=
False
):
labels
=
inputs
.
get
(
"labels"
)
labels
=
inputs
.
pop
(
"labels"
)
# forward pass
outputs
=
model
(
**
inputs
)
logits
=
outputs
.
get
(
"logits"
)
...
...
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