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
2feb29c0
Unverified
Commit
2feb29c0
authored
Dec 19, 2018
by
Thomas Wolf
Committed by
GitHub
Dec 19, 2018
Browse files
Merge pull request #130 from sodre/use-entry-points
Use entry-points instead of scripts
parents
2c999149
ecf3ea19
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
bin/pytorch_pretrained_bert
bin/pytorch_pretrained_bert
+0
-2
pytorch_pretrained_bert/__main__.py
pytorch_pretrained_bert/__main__.py
+4
-1
setup.py
setup.py
+5
-1
No files found.
bin/pytorch_pretrained_bert
deleted
100644 → 0
View file @
2c999149
#!/bin/sh
python
-m
pytorch_pretrained_bert
"
$@
"
\ No newline at end of file
pytorch_pretrained_bert/__main__.py
View file @
2feb29c0
# coding: utf8
if
__name__
==
'__
main
__'
:
def
main
()
:
import
sys
try
:
from
.convert_tf_checkpoint_to_pytorch
import
convert_tf_checkpoint_to_pytorch
...
...
@@ -17,3 +17,6 @@ if __name__ == '__main__':
TF_CONFIG
=
sys
.
argv
.
pop
()
TF_CHECKPOINT
=
sys
.
argv
.
pop
()
convert_tf_checkpoint_to_pytorch
(
TF_CHECKPOINT
,
TF_CONFIG
,
PYTORCH_DUMP_OUTPUT
)
if
__name__
==
'__main__'
:
main
()
setup.py
View file @
2feb29c0
...
...
@@ -53,7 +53,11 @@ setup(
'boto3'
,
'requests'
,
'tqdm'
],
scripts
=
[
"bin/pytorch_pretrained_bert"
],
entry_points
=
{
'console_scripts'
:
[
"pytorch_pretrained_bert=pytorch_pretrained_bert.__main__:main"
]
},
python_requires
=
'>=3.5.0'
,
tests_require
=
[
'pytest'
],
classifiers
=
[
...
...
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