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
78596105
Commit
78596105
authored
Jul 31, 2024
by
dcuai
Browse files
Merge branch 'main' into 'main'
bugfix: 单卡情况下,model变量没有module属性 See merge request
!1
parents
34ba3166
3d287dd3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
single_dcu_train.py
single_dcu_train.py
+8
-1
No files found.
single_dcu_train.py
View file @
78596105
...
@@ -203,7 +203,14 @@ if __name__=='__main__':
...
@@ -203,7 +203,14 @@ if __name__=='__main__':
now
=
datetime
.
now
()
now
=
datetime
.
now
()
timestamp
=
now
.
strftime
(
"%Y%m%d_%H%M%S"
)
timestamp
=
now
.
strftime
(
"%Y%m%d_%H%M%S"
)
new_model_path
=
f
'./saves/umt5_
{
timestamp
}
'
new_model_path
=
f
'./saves/umt5_
{
timestamp
}
'
model
.
module
.
save_pretrained
(
new_model_path
)
if
hasattr
(
model
,
'module'
):
# 多卡
model
.
module
.
save_pretrained
(
new_model_path
)
else
:
# 单卡
model
.
save_pretrained
(
new_model_path
)
tokenizer
.
save_pretrained
(
new_model_path
)
tokenizer
.
save_pretrained
(
new_model_path
)
print
(
"Done!"
)
print
(
"Done!"
)
...
...
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