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
0bab55d5
Commit
0bab55d5
authored
Jul 05, 2019
by
thomwolf
Browse files
[BIG] name change
parent
9113b50c
Changes
75
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
20 additions
and
20 deletions
+20
-20
pytorch_transformers/tests/optimization_test.py
pytorch_transformers/tests/optimization_test.py
+3
-3
pytorch_transformers/tests/tokenization_bert_test.py
pytorch_transformers/tests/tokenization_bert_test.py
+2
-2
pytorch_transformers/tests/tokenization_gpt2_test.py
pytorch_transformers/tests/tokenization_gpt2_test.py
+2
-2
pytorch_transformers/tests/tokenization_openai_test.py
pytorch_transformers/tests/tokenization_openai_test.py
+2
-2
pytorch_transformers/tests/tokenization_tests_commons.py
pytorch_transformers/tests/tokenization_tests_commons.py
+0
-0
pytorch_transformers/tests/tokenization_transfo_xl_test.py
pytorch_transformers/tests/tokenization_transfo_xl_test.py
+2
-2
pytorch_transformers/tests/tokenization_xlm_test.py
pytorch_transformers/tests/tokenization_xlm_test.py
+2
-2
pytorch_transformers/tests/tokenization_xlnet_test.py
pytorch_transformers/tests/tokenization_xlnet_test.py
+2
-2
pytorch_transformers/tokenization_bert.py
pytorch_transformers/tokenization_bert.py
+0
-0
pytorch_transformers/tokenization_gpt2.py
pytorch_transformers/tokenization_gpt2.py
+0
-0
pytorch_transformers/tokenization_openai.py
pytorch_transformers/tokenization_openai.py
+0
-0
pytorch_transformers/tokenization_transfo_xl.py
pytorch_transformers/tokenization_transfo_xl.py
+0
-0
pytorch_transformers/tokenization_xlm.py
pytorch_transformers/tokenization_xlm.py
+0
-0
pytorch_transformers/tokenization_xlnet.py
pytorch_transformers/tokenization_xlnet.py
+0
-0
setup.py
setup.py
+5
-5
No files found.
pytorch_
pretrained_b
er
t
/tests/optimization_test.py
→
pytorch_
transform
er
s
/tests/optimization_test.py
View file @
0bab55d5
...
@@ -20,9 +20,9 @@ import unittest
...
@@ -20,9 +20,9 @@ import unittest
import
torch
import
torch
from
pytorch_
pretrained_b
er
t
import
BertAdam
from
pytorch_
transform
er
s
import
BertAdam
from
pytorch_
pretrained_b
er
t
import
OpenAIAdam
from
pytorch_
transform
er
s
import
OpenAIAdam
from
pytorch_
pretrained_b
er
t
.optimization
import
ConstantLR
,
WarmupLinearSchedule
,
WarmupConstantSchedule
,
\
from
pytorch_
transform
er
s
.optimization
import
ConstantLR
,
WarmupLinearSchedule
,
WarmupConstantSchedule
,
\
WarmupCosineWithWarmupRestartsSchedule
,
WarmupCosineWithHardRestartsSchedule
,
WarmupCosineSchedule
WarmupCosineWithWarmupRestartsSchedule
,
WarmupCosineWithHardRestartsSchedule
,
WarmupCosineSchedule
import
numpy
as
np
import
numpy
as
np
...
...
pytorch_
pretrained_b
er
t
/tests/tokenization_bert_test.py
→
pytorch_
transform
er
s
/tests/tokenization_bert_test.py
View file @
0bab55d5
...
@@ -20,7 +20,7 @@ from io import open
...
@@ -20,7 +20,7 @@ from io import open
import
shutil
import
shutil
import
pytest
import
pytest
from
pytorch_
pretrained_b
er
t
.tokenization_bert
import
(
BasicTokenizer
,
from
pytorch_
transform
er
s
.tokenization_bert
import
(
BasicTokenizer
,
BertTokenizer
,
BertTokenizer
,
WordpieceTokenizer
,
WordpieceTokenizer
,
_is_control
,
_is_punctuation
,
_is_control
,
_is_punctuation
,
...
@@ -51,7 +51,7 @@ class TokenizationTest(unittest.TestCase):
...
@@ -51,7 +51,7 @@ class TokenizationTest(unittest.TestCase):
@
pytest
.
mark
.
slow
@
pytest
.
mark
.
slow
def
test_tokenizer_from_pretrained
(
self
):
def
test_tokenizer_from_pretrained
(
self
):
cache_dir
=
"/tmp/pytorch_
pretrained_b
er
t
_test/"
cache_dir
=
"/tmp/pytorch_
transform
er
s
_test/"
for
model_name
in
list
(
PRETRAINED_VOCAB_ARCHIVE_MAP
.
keys
())[:
1
]:
for
model_name
in
list
(
PRETRAINED_VOCAB_ARCHIVE_MAP
.
keys
())[:
1
]:
tokenizer
=
BertTokenizer
.
from_pretrained
(
model_name
,
cache_dir
=
cache_dir
)
tokenizer
=
BertTokenizer
.
from_pretrained
(
model_name
,
cache_dir
=
cache_dir
)
shutil
.
rmtree
(
cache_dir
)
shutil
.
rmtree
(
cache_dir
)
...
...
pytorch_
pretrained_b
er
t
/tests/tokenization_gpt2_test.py
→
pytorch_
transform
er
s
/tests/tokenization_gpt2_test.py
View file @
0bab55d5
...
@@ -20,7 +20,7 @@ import json
...
@@ -20,7 +20,7 @@ import json
import
shutil
import
shutil
import
pytest
import
pytest
from
pytorch_
pretrained_b
er
t
.tokenization_gpt2
import
GPT2Tokenizer
,
PRETRAINED_VOCAB_ARCHIVE_MAP
from
pytorch_
transform
er
s
.tokenization_gpt2
import
GPT2Tokenizer
,
PRETRAINED_VOCAB_ARCHIVE_MAP
from
.tokenization_tests_commons
import
create_and_check_tokenizer_commons
from
.tokenization_tests_commons
import
create_and_check_tokenizer_commons
...
@@ -58,7 +58,7 @@ class GPT2TokenizationTest(unittest.TestCase):
...
@@ -58,7 +58,7 @@ class GPT2TokenizationTest(unittest.TestCase):
# @pytest.mark.slow
# @pytest.mark.slow
def
test_tokenizer_from_pretrained
(
self
):
def
test_tokenizer_from_pretrained
(
self
):
cache_dir
=
"/tmp/pytorch_
pretrained_b
er
t
_test/"
cache_dir
=
"/tmp/pytorch_
transform
er
s
_test/"
for
model_name
in
list
(
PRETRAINED_VOCAB_ARCHIVE_MAP
.
keys
())[:
1
]:
for
model_name
in
list
(
PRETRAINED_VOCAB_ARCHIVE_MAP
.
keys
())[:
1
]:
tokenizer
=
GPT2Tokenizer
.
from_pretrained
(
model_name
,
cache_dir
=
cache_dir
)
tokenizer
=
GPT2Tokenizer
.
from_pretrained
(
model_name
,
cache_dir
=
cache_dir
)
shutil
.
rmtree
(
cache_dir
)
shutil
.
rmtree
(
cache_dir
)
...
...
pytorch_
pretrained_b
er
t
/tests/tokenization_openai_test.py
→
pytorch_
transform
er
s
/tests/tokenization_openai_test.py
View file @
0bab55d5
...
@@ -20,7 +20,7 @@ import json
...
@@ -20,7 +20,7 @@ import json
import
shutil
import
shutil
import
pytest
import
pytest
from
pytorch_
pretrained_b
er
t
.tokenization_openai
import
OpenAIGPTTokenizer
,
PRETRAINED_VOCAB_ARCHIVE_MAP
from
pytorch_
transform
er
s
.tokenization_openai
import
OpenAIGPTTokenizer
,
PRETRAINED_VOCAB_ARCHIVE_MAP
from
.
tokenization_tests_commons
import
create_and_check_tokenizer_commons
from
.
tokenization_tests_commons
import
create_and_check_tokenizer_commons
...
@@ -60,7 +60,7 @@ class OpenAIGPTTokenizationTest(unittest.TestCase):
...
@@ -60,7 +60,7 @@ class OpenAIGPTTokenizationTest(unittest.TestCase):
@
pytest
.
mark
.
slow
@
pytest
.
mark
.
slow
def
test_tokenizer_from_pretrained
(
self
):
def
test_tokenizer_from_pretrained
(
self
):
cache_dir
=
"/tmp/pytorch_
pretrained_b
er
t
_test/"
cache_dir
=
"/tmp/pytorch_
transform
er
s
_test/"
for
model_name
in
list
(
PRETRAINED_VOCAB_ARCHIVE_MAP
.
keys
())[:
1
]:
for
model_name
in
list
(
PRETRAINED_VOCAB_ARCHIVE_MAP
.
keys
())[:
1
]:
tokenizer
=
OpenAIGPTTokenizer
.
from_pretrained
(
model_name
,
cache_dir
=
cache_dir
)
tokenizer
=
OpenAIGPTTokenizer
.
from_pretrained
(
model_name
,
cache_dir
=
cache_dir
)
shutil
.
rmtree
(
cache_dir
)
shutil
.
rmtree
(
cache_dir
)
...
...
pytorch_
pretrained_b
er
t
/tests/tokenization_tests_commons.py
→
pytorch_
transform
er
s
/tests/tokenization_tests_commons.py
View file @
0bab55d5
File moved
pytorch_
pretrained_b
er
t
/tests/tokenization_transfo_xl_test.py
→
pytorch_
transform
er
s
/tests/tokenization_transfo_xl_test.py
View file @
0bab55d5
...
@@ -20,7 +20,7 @@ from io import open
...
@@ -20,7 +20,7 @@ from io import open
import
shutil
import
shutil
import
pytest
import
pytest
from
pytorch_
pretrained_b
er
t
.tokenization_transfo_xl
import
TransfoXLTokenizer
,
PRETRAINED_VOCAB_ARCHIVE_MAP
from
pytorch_
transform
er
s
.tokenization_transfo_xl
import
TransfoXLTokenizer
,
PRETRAINED_VOCAB_ARCHIVE_MAP
from
.
tokenization_tests_commons
import
create_and_check_tokenizer_commons
from
.
tokenization_tests_commons
import
create_and_check_tokenizer_commons
...
@@ -61,7 +61,7 @@ class TransfoXLTokenizationTest(unittest.TestCase):
...
@@ -61,7 +61,7 @@ class TransfoXLTokenizationTest(unittest.TestCase):
@
pytest
.
mark
.
slow
@
pytest
.
mark
.
slow
def
test_tokenizer_from_pretrained
(
self
):
def
test_tokenizer_from_pretrained
(
self
):
cache_dir
=
"/tmp/pytorch_
pretrained_b
er
t
_test/"
cache_dir
=
"/tmp/pytorch_
transform
er
s
_test/"
for
model_name
in
list
(
PRETRAINED_VOCAB_ARCHIVE_MAP
.
keys
())[:
1
]:
for
model_name
in
list
(
PRETRAINED_VOCAB_ARCHIVE_MAP
.
keys
())[:
1
]:
tokenizer
=
TransfoXLTokenizer
.
from_pretrained
(
model_name
,
cache_dir
=
cache_dir
)
tokenizer
=
TransfoXLTokenizer
.
from_pretrained
(
model_name
,
cache_dir
=
cache_dir
)
shutil
.
rmtree
(
cache_dir
)
shutil
.
rmtree
(
cache_dir
)
...
...
pytorch_
pretrained_b
er
t
/tests/tokenization_xlm_test.py
→
pytorch_
transform
er
s
/tests/tokenization_xlm_test.py
View file @
0bab55d5
...
@@ -20,7 +20,7 @@ import json
...
@@ -20,7 +20,7 @@ import json
import
shutil
import
shutil
import
pytest
import
pytest
from
pytorch_
pretrained_b
er
t
.tokenization_xlm
import
XLMTokenizer
,
PRETRAINED_VOCAB_ARCHIVE_MAP
from
pytorch_
transform
er
s
.tokenization_xlm
import
XLMTokenizer
,
PRETRAINED_VOCAB_ARCHIVE_MAP
from
.
tokenization_tests_commons
import
create_and_check_tokenizer_commons
from
.
tokenization_tests_commons
import
create_and_check_tokenizer_commons
...
@@ -59,7 +59,7 @@ class XLMTokenizationTest(unittest.TestCase):
...
@@ -59,7 +59,7 @@ class XLMTokenizationTest(unittest.TestCase):
@
pytest
.
mark
.
slow
@
pytest
.
mark
.
slow
def
test_tokenizer_from_pretrained
(
self
):
def
test_tokenizer_from_pretrained
(
self
):
cache_dir
=
"/tmp/pytorch_
pretrained_b
er
t
_test/"
cache_dir
=
"/tmp/pytorch_
transform
er
s
_test/"
for
model_name
in
list
(
PRETRAINED_VOCAB_ARCHIVE_MAP
.
keys
())[:
1
]:
for
model_name
in
list
(
PRETRAINED_VOCAB_ARCHIVE_MAP
.
keys
())[:
1
]:
tokenizer
=
XLMTokenizer
.
from_pretrained
(
model_name
,
cache_dir
=
cache_dir
)
tokenizer
=
XLMTokenizer
.
from_pretrained
(
model_name
,
cache_dir
=
cache_dir
)
shutil
.
rmtree
(
cache_dir
)
shutil
.
rmtree
(
cache_dir
)
...
...
pytorch_
pretrained_b
er
t
/tests/tokenization_xlnet_test.py
→
pytorch_
transform
er
s
/tests/tokenization_xlnet_test.py
View file @
0bab55d5
...
@@ -19,7 +19,7 @@ import unittest
...
@@ -19,7 +19,7 @@ import unittest
import
shutil
import
shutil
import
pytest
import
pytest
from
pytorch_
pretrained_b
er
t
.tokenization_xlnet
import
(
XLNetTokenizer
,
from
pytorch_
transform
er
s
.tokenization_xlnet
import
(
XLNetTokenizer
,
PRETRAINED_VOCAB_ARCHIVE_MAP
,
PRETRAINED_VOCAB_ARCHIVE_MAP
,
SPIECE_UNDERLINE
)
SPIECE_UNDERLINE
)
...
@@ -62,7 +62,7 @@ class XLNetTokenizationTest(unittest.TestCase):
...
@@ -62,7 +62,7 @@ class XLNetTokenizationTest(unittest.TestCase):
@
pytest
.
mark
.
slow
@
pytest
.
mark
.
slow
def
test_tokenizer_from_pretrained
(
self
):
def
test_tokenizer_from_pretrained
(
self
):
cache_dir
=
"/tmp/pytorch_
pretrained_b
er
t
_test/"
cache_dir
=
"/tmp/pytorch_
transform
er
s
_test/"
for
model_name
in
list
(
PRETRAINED_VOCAB_ARCHIVE_MAP
.
keys
())[:
1
]:
for
model_name
in
list
(
PRETRAINED_VOCAB_ARCHIVE_MAP
.
keys
())[:
1
]:
tokenizer
=
XLNetTokenizer
.
from_pretrained
(
model_name
,
cache_dir
=
cache_dir
)
tokenizer
=
XLNetTokenizer
.
from_pretrained
(
model_name
,
cache_dir
=
cache_dir
)
shutil
.
rmtree
(
cache_dir
)
shutil
.
rmtree
(
cache_dir
)
...
...
pytorch_
pretrained_b
er
t
/tokenization_bert.py
→
pytorch_
transform
er
s
/tokenization_bert.py
View file @
0bab55d5
File moved
pytorch_
pretrained_b
er
t
/tokenization_gpt2.py
→
pytorch_
transform
er
s
/tokenization_gpt2.py
View file @
0bab55d5
File moved
pytorch_
pretrained_b
er
t
/tokenization_openai.py
→
pytorch_
transform
er
s
/tokenization_openai.py
View file @
0bab55d5
File moved
pytorch_
pretrained_b
er
t
/tokenization_transfo_xl.py
→
pytorch_
transform
er
s
/tokenization_transfo_xl.py
View file @
0bab55d5
File moved
pytorch_
pretrained_b
er
t
/tokenization_xlm.py
→
pytorch_
transform
er
s
/tokenization_xlm.py
View file @
0bab55d5
File moved
pytorch_
pretrained_b
er
t
/tokenization_xlnet.py
→
pytorch_
transform
er
s
/tokenization_xlnet.py
View file @
0bab55d5
File moved
setup.py
View file @
0bab55d5
...
@@ -37,16 +37,16 @@ from io import open
...
@@ -37,16 +37,16 @@ from io import open
from
setuptools
import
find_packages
,
setup
from
setuptools
import
find_packages
,
setup
setup
(
setup
(
name
=
"pytorch_
pretrained_b
er
t
"
,
name
=
"pytorch_
transform
er
s
"
,
version
=
"0.
6.2
"
,
version
=
"0.
7.0
"
,
author
=
"Thomas Wolf, Victor Sanh, Tim Rault, Google AI Language Team Authors, Open AI team Authors"
,
author
=
"Thomas Wolf,
Lysandre Debut,
Victor Sanh, Tim Rault, Google AI Language Team Authors, Open AI team Authors"
,
author_email
=
"thomas@huggingface.co"
,
author_email
=
"thomas@huggingface.co"
,
description
=
"PyTorch version of Google AI BERT model with script to load Google pre-trained models"
,
description
=
"PyTorch version of Google AI BERT model with script to load Google pre-trained models"
,
long_description
=
open
(
"README.md"
,
"r"
,
encoding
=
'utf-8'
).
read
(),
long_description
=
open
(
"README.md"
,
"r"
,
encoding
=
'utf-8'
).
read
(),
long_description_content_type
=
"text/markdown"
,
long_description_content_type
=
"text/markdown"
,
keywords
=
'BERT NLP deep learning google'
,
keywords
=
'BERT NLP deep learning google'
,
license
=
'Apache'
,
license
=
'Apache'
,
url
=
"https://github.com/huggingface/pytorch-
pretrained-BERT
"
,
url
=
"https://github.com/huggingface/pytorch-
transformers
"
,
packages
=
find_packages
(
exclude
=
[
"*.tests"
,
"*.tests.*"
,
packages
=
find_packages
(
exclude
=
[
"*.tests"
,
"*.tests.*"
,
"tests.*"
,
"tests"
]),
"tests.*"
,
"tests"
]),
install_requires
=
[
'torch>=0.4.1'
,
install_requires
=
[
'torch>=0.4.1'
,
...
@@ -58,7 +58,7 @@ setup(
...
@@ -58,7 +58,7 @@ setup(
'sentencepiece'
],
'sentencepiece'
],
entry_points
=
{
entry_points
=
{
'console_scripts'
:
[
'console_scripts'
:
[
"pytorch_
pretrained_b
er
t
=pytorch_
pretrained_b
er
t
.__main__:main"
,
"pytorch_
transform
er
s
=pytorch_
transform
er
s
.__main__:main"
,
]
]
},
},
# python_requires='>=3.5.0',
# python_requires='>=3.5.0',
...
...
Prev
1
2
3
4
Next
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