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
0a9d7c7e
Unverified
Commit
0a9d7c7e
authored
Jan 18, 2019
by
Thomas Wolf
Committed by
GitHub
Jan 18, 2019
Browse files
Merge pull request #201 from Liangtaiwan/squad2_save_bug
run_squad2 Don't save model if do not train
parents
f040a43c
be9fa192
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
examples/run_squad2.py
examples/run_squad2.py
+2
-1
No files found.
examples/run_squad2.py
View file @
0a9d7c7e
...
...
@@ -1010,6 +1010,7 @@ def main():
# Save a trained model
model_to_save
=
model
.
module
if
hasattr
(
model
,
'module'
)
else
model
# Only save the model it-self
output_model_file
=
os
.
path
.
join
(
args
.
output_dir
,
"pytorch_model.bin"
)
if
args
.
do_train
:
torch
.
save
(
model_to_save
.
state_dict
(),
output_model_file
)
# Load a trained model that you have fine-tuned
...
...
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