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
d0adab2c
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "44286b94d3376f56ee7ef039790d40798d5f9e7d"
Commit
d0adab2c
authored
May 22, 2019
by
Chris
Browse files
fn change; pytorch_model_dir required=False
parent
a309459b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
pytorch_pretrained_bert/convert_pytorch_checkpoint_to_tf.py
pytorch_pretrained_bert/convert_pytorch_checkpoint_to_tf.py
+2
-2
No files found.
pytorch_pretrained_bert/convert_pytorch_checkpoint_to_tf.py
View file @
d0adab2c
...
...
@@ -22,7 +22,7 @@ import tensorflow as tf
from
pytorch_pretrained_bert.modeling
import
BertConfig
,
BertModel
def
convert_h
f
_checkpoint_to_tf
(
model
:
type
(
BertModel
),
ckpt_dir
:
str
):
def
convert_
pytorc
h_checkpoint_to_tf
(
model
:
type
(
BertModel
),
ckpt_dir
:
str
):
"""
:param model:BertModel Pytorch model instance to be converted
...
...
@@ -107,4 +107,4 @@ if __name__ == "__main__":
model
=
BertModel
(
config
=
BertConfig
(
args
.
config_file_path
)
).
from_pretrained
(
args
.
pytorch_model_name
,
cache_dir
=
args
.
pytorch_model_dir
)
convert_h
f
_checkpoint_to_tf
(
model
=
model
,
ckpt_dir
=
args
.
tf_checkpoint_dir
)
convert_
pytorc
h_checkpoint_to_tf
(
model
=
model
,
ckpt_dir
=
args
.
tf_checkpoint_dir
)
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