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
41089bc7
Commit
41089bc7
authored
May 02, 2019
by
Chris
Browse files
added file to convert pytorch->tf
parent
0a8b4d65
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
pytorch_pretrained_bert/convert_hf_checkpoint_to_tf.py
pytorch_pretrained_bert/convert_hf_checkpoint_to_tf.py
+2
-2
No files found.
pytorch_pretrained_bert/convert_hf_checkpoint_to_tf.py
View file @
41089bc7
...
@@ -121,11 +121,11 @@ if __name__ == "__main__":
...
@@ -121,11 +121,11 @@ if __name__ == "__main__":
default
=
None
,
default
=
None
,
type
=
str
,
type
=
str
,
required
=
True
,
required
=
True
,
help
=
"
p
ath to a folder in which the TF model will be cached."
)
help
=
"
P
ath to a folder in which the TF model will be cached."
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
model
=
BertModel
(
model
=
BertModel
(
config
=
BertConfig
(
args
.
config_file_path
)
config
=
BertConfig
(
args
.
config_file_path
)
).
from_pretrained
(
args
.
pretrained_model_name_or_path
)
).
from_pretrained
(
args
.
pretrained_model_name_or_path
)
convert_hf_checkpoint_to_tf
(
model
=
model
,
ckpt_dir
=
args
.
cache_
)
convert_hf_checkpoint_to_tf
(
model
=
model
,
ckpt_dir
=
args
.
cache_dir
)
\ No newline at end of file
\ No newline at end of file
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