mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 18:22:34 +06:00
Merge pull request #130 from sodre/use-entry-points
Use entry-points instead of scripts
This commit is contained in:
commit
2feb29c0ff
@ -1,2 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
python -m pytorch_pretrained_bert "$@"
|
|
@ -1,5 +1,5 @@
|
|||||||
# coding: utf8
|
# coding: utf8
|
||||||
if __name__ == '__main__':
|
def main():
|
||||||
import sys
|
import sys
|
||||||
try:
|
try:
|
||||||
from .convert_tf_checkpoint_to_pytorch import convert_tf_checkpoint_to_pytorch
|
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_CONFIG = sys.argv.pop()
|
||||||
TF_CHECKPOINT = sys.argv.pop()
|
TF_CHECKPOINT = sys.argv.pop()
|
||||||
convert_tf_checkpoint_to_pytorch(TF_CHECKPOINT, TF_CONFIG, PYTORCH_DUMP_OUTPUT)
|
convert_tf_checkpoint_to_pytorch(TF_CHECKPOINT, TF_CONFIG, PYTORCH_DUMP_OUTPUT)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
6
setup.py
6
setup.py
@ -53,7 +53,11 @@ setup(
|
|||||||
'boto3',
|
'boto3',
|
||||||
'requests',
|
'requests',
|
||||||
'tqdm'],
|
'tqdm'],
|
||||||
scripts=["bin/pytorch_pretrained_bert"],
|
entry_points={
|
||||||
|
'console_scripts': [
|
||||||
|
"pytorch_pretrained_bert=pytorch_pretrained_bert.__main__:main"
|
||||||
|
]
|
||||||
|
},
|
||||||
python_requires='>=3.5.0',
|
python_requires='>=3.5.0',
|
||||||
tests_require=['pytest'],
|
tests_require=['pytest'],
|
||||||
classifiers=[
|
classifiers=[
|
||||||
|
Loading…
Reference in New Issue
Block a user