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
981a5c8c
Commit
981a5c8c
authored
Dec 10, 2019
by
thomwolf
Browse files
updating models urls
parent
8ae1044f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
4 deletions
+24
-4
transformers/configuration_t5.py
transformers/configuration_t5.py
+4
-0
transformers/convert_pytorch_checkpoint_to_tf2.py
transformers/convert_pytorch_checkpoint_to_tf2.py
+1
-1
transformers/modeling_t5.py
transformers/modeling_t5.py
+4
-0
transformers/modeling_tf_t5.py
transformers/modeling_tf_t5.py
+5
-1
transformers/tokenization_t5.py
transformers/tokenization_t5.py
+10
-2
No files found.
transformers/configuration_t5.py
View file @
981a5c8c
...
@@ -28,6 +28,10 @@ logger = logging.getLogger(__name__)
...
@@ -28,6 +28,10 @@ logger = logging.getLogger(__name__)
T5_PRETRAINED_CONFIG_ARCHIVE_MAP
=
{
T5_PRETRAINED_CONFIG_ARCHIVE_MAP
=
{
't5-small'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-small-config.json"
,
't5-small'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-small-config.json"
,
't5-base'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-base-config.json"
,
't5-large'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-large-config.json"
,
't5-3B'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-3B-config.json"
,
't5-11B'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-11B-config.json"
,
}
}
...
...
transformers/convert_pytorch_checkpoint_to_tf2.py
View file @
981a5c8c
...
@@ -121,7 +121,7 @@ def convert_pt_checkpoint_to_tf(model_type, pytorch_checkpoint_path, config_file
...
@@ -121,7 +121,7 @@ def convert_pt_checkpoint_to_tf(model_type, pytorch_checkpoint_path, config_file
if
compare_with_pt_model
:
if
compare_with_pt_model
:
inputs_list
=
[[
7
,
6
,
0
,
0
,
1
],
[
1
,
2
,
3
,
0
,
0
],
[
0
,
0
,
0
,
4
,
5
]]
inputs_list
=
[[
7
,
6
,
0
,
0
,
1
],
[
1
,
2
,
3
,
0
,
0
],
[
0
,
0
,
0
,
4
,
5
]]
tf_inputs
=
tf
.
constant
(
inputs_list
)
tf_inputs
=
tf
_model
.
dummy_inputs
tfo
=
tf_model
(
tf_inputs
,
training
=
False
)
# build the network
tfo
=
tf_model
(
tf_inputs
,
training
=
False
)
# build the network
pt_model
=
pt_model_class
.
from_pretrained
(
None
,
pt_model
=
pt_model_class
.
from_pretrained
(
None
,
...
...
transformers/modeling_t5.py
View file @
981a5c8c
...
@@ -42,6 +42,10 @@ logger = logging.getLogger(__name__)
...
@@ -42,6 +42,10 @@ logger = logging.getLogger(__name__)
####################################################
####################################################
T5_PRETRAINED_MODEL_ARCHIVE_MAP
=
{
T5_PRETRAINED_MODEL_ARCHIVE_MAP
=
{
't5-small'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-small-pytorch_model.bin"
,
't5-small'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-small-pytorch_model.bin"
,
't5-base'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-base-pytorch_model.bin"
,
't5-large'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-large-pytorch_model.bin"
,
't5-3B'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-3B-pytorch_model.bin"
,
't5-11B'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-11B-pytorch_model.bin"
,
}
}
####################################################
####################################################
...
...
transformers/modeling_tf_t5.py
View file @
981a5c8c
...
@@ -25,13 +25,17 @@ import itertools
...
@@ -25,13 +25,17 @@ import itertools
import
tensorflow
as
tf
import
tensorflow
as
tf
from
.configuration_t5
import
T5Config
from
.configuration_t5
import
T5Config
from
.modeling_tf_utils
import
TFPreTrainedModel
,
TFSharedEmbeddings
,
shape_list
,
get_initializer
,
DUMMY_INPUTS
from
.modeling_tf_utils
import
TFPreTrainedModel
,
TFSharedEmbeddings
,
shape_list
from
.file_utils
import
add_start_docstrings
from
.file_utils
import
add_start_docstrings
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
TF_T5_PRETRAINED_MODEL_ARCHIVE_MAP
=
{
TF_T5_PRETRAINED_MODEL_ARCHIVE_MAP
=
{
't5-small'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-small-tf_model.h5"
,
't5-small'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-small-tf_model.h5"
,
't5-base'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-base-tf_model.h5"
,
't5-large'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-large-tf_model.h5"
,
't5-3B'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-3B-tf_model.h5"
,
't5-11B'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-11B-tf_model.h5"
,
}
}
####################################################
####################################################
...
...
transformers/tokenization_t5.py
View file @
981a5c8c
...
@@ -41,7 +41,11 @@ VOCAB_FILES_NAMES = {'vocab_file': 'spiece.model'}
...
@@ -41,7 +41,11 @@ VOCAB_FILES_NAMES = {'vocab_file': 'spiece.model'}
PRETRAINED_VOCAB_FILES_MAP
=
{
PRETRAINED_VOCAB_FILES_MAP
=
{
'vocab_file'
:
'vocab_file'
:
{
{
't5'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-spiece.model"
,
't5-small'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-spiece.model"
,
't5-base'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-spiece.model"
,
't5-large'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-spiece.model"
,
't5-3B'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-spiece.model"
,
't5-11B'
:
"https://s3.amazonaws.com/models.huggingface.co/bert/t5-spiece.model"
,
}
}
}
}
...
@@ -49,7 +53,11 @@ PRETRAINED_VOCAB_FILES_MAP = {
...
@@ -49,7 +53,11 @@ PRETRAINED_VOCAB_FILES_MAP = {
# Mapping from model shortcut names to max length of inputs
# Mapping from model shortcut names to max length of inputs
####################################################
####################################################
PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
=
{
PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
=
{
't5'
:
512
,
't5-small'
:
512
,
't5-base'
:
512
,
't5-large'
:
512
,
't5-3B'
:
512
,
't5-11B'
:
512
,
}
}
class
T5Tokenizer
(
PreTrainedTokenizer
):
class
T5Tokenizer
(
PreTrainedTokenizer
):
...
...
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