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
ModelZoo
UMT5_pytorch
Commits
3ed28c37
Commit
3ed28c37
authored
Aug 23, 2024
by
wanglch
Browse files
Update train_multi_dcu.py
parent
a9deb018
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
train_multi_dcu.py
train_multi_dcu.py
+1
-1
No files found.
train_multi_dcu.py
View file @
3ed28c37
...
...
@@ -104,7 +104,7 @@ def test_loop(dataloader, model):
batch_data
=
{
k
:
v
.
to
(
device
)
for
k
,
v
in
batch_data
.
items
()}
with
torch
.
no_grad
():
# 如果你使用了 DataParallel,你可以通过访问 model.module 来获取原始模型
generated_tokens
=
model
.
generate
(
generated_tokens
=
model
.
module
.
generate
(
batch_data
[
"input_ids"
],
attention_mask
=
batch_data
[
"attention_mask"
],
max_length
=
max_target_length
,
...
...
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