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
221d4c63
Unverified
Commit
221d4c63
authored
Sep 11, 2020
by
Patrick von Platen
Committed by
GitHub
Sep 11, 2020
Browse files
clean naming (#7068)
parent
8fcbe486
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
10 deletions
+10
-10
src/transformers/configuration_auto.py
src/transformers/configuration_auto.py
+1
-1
src/transformers/configuration_bert_generation.py
src/transformers/configuration_bert_generation.py
+5
-5
src/transformers/modeling_bert_generation.py
src/transformers/modeling_bert_generation.py
+1
-1
src/transformers/tokenization_bert_generation.py
src/transformers/tokenization_bert_generation.py
+1
-1
tests/test_modeling_encoder_decoder.py
tests/test_modeling_encoder_decoder.py
+1
-1
tests/test_tokenization_bert_generation.py
tests/test_tokenization_bert_generation.py
+1
-1
No files found.
src/transformers/configuration_auto.py
View file @
221d4c63
...
...
@@ -99,7 +99,7 @@ CONFIG_MAPPING = OrderedDict(
AlbertConfig
,
),
(
"bert-
for-seq-
generation"
,
"bert-generation"
,
BertGenerationConfig
,
),
(
...
...
src/transformers/configuration_bert_generation.py
View file @
221d4c63
...
...
@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
""" Bert
ForSeq
Generation model configuration """
""" BertGeneration model configuration """
from
.configuration_utils
import
PretrainedConfig
...
...
@@ -29,8 +29,8 @@ class BertGenerationConfig(PretrainedConfig):
Args:
vocab_size (:obj:`int`, `optional`, defaults to 50358):
Vocabulary size of the Bert
ForSeq
Generation model. Defines the different tokens that
can be represented by the `inputs_ids` passed to the forward method of :class:`~transformers.Bert
ForSeq
Generation`.
Vocabulary size of the BertGeneration model. Defines the different tokens that
can be represented by the `inputs_ids` passed to the forward method of :class:`~transformers.BertGeneration`.
hidden_size (:obj:`int`, `optional`, defaults to 1024):
Dimensionality of the encoder layers and the pooler layer.
num_hidden_layers (:obj:`int`, `optional`, defaults to 24):
...
...
@@ -60,7 +60,7 @@ class BertGenerationConfig(PretrainedConfig):
>>> from transformers import BertGenerationConfig, BertGenerationEncoder
>>> # Initializing a Bert
ForSeq
Generation config
>>> # Initializing a BertGeneration config
>>> configuration = BertGenerationConfig()
>>> # Initializing a modelfrom the config
...
...
@@ -69,7 +69,7 @@ class BertGenerationConfig(PretrainedConfig):
>>> # Accessing the model configuration
>>> configuration = model.config
"""
model_type
=
"bert-
for-seq-
generation"
model_type
=
"bert-generation"
def
__init__
(
self
,
...
...
src/transformers/modeling_bert_generation.py
View file @
221d4c63
...
...
@@ -238,7 +238,7 @@ BERT_GENERATION_INPUTS_DOCSTRING = r"""
@
add_start_docstrings
(
"The bare Bert
ForSeq
Generation model transformer outputting raw hidden-states without any specific head on top."
,
"The bare BertGeneration model transformer outputting raw hidden-states without any specific head on top."
,
BERT_GENERATION_START_DOCSTRING
,
)
class
BertGenerationEncoder
(
BertGenerationPreTrainedModel
):
...
...
src/transformers/tokenization_bert_generation.py
View file @
221d4c63
...
...
@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
""" Tokenization class for model Bert
ForSeq
Generation."""
""" Tokenization class for model BertGeneration."""
import
os
...
...
tests/test_modeling_encoder_decoder.py
View file @
221d4c63
...
...
@@ -493,7 +493,7 @@ class BertEncoderDecoderModelTest(EncoderDecoderMixin, unittest.TestCase):
self
.
assertEqual
(
summary
,
EXPECTED_SUMMARY
)
class
Bert
ForSeq
GenerationEncoderDecoderModelTest
(
EncoderDecoderMixin
,
unittest
.
TestCase
):
class
BertGenerationEncoderDecoderModelTest
(
EncoderDecoderMixin
,
unittest
.
TestCase
):
def
get_pretrained_model
(
self
):
return
EncoderDecoderModel
.
from_encoder_decoder_pretrained
(
"google/bert_for_seq_generation_L-24_bbc_encoder"
,
"google/bert_for_seq_generation_L-24_bbc_encoder"
...
...
tests/test_tokenization_bert_generation.py
View file @
221d4c63
...
...
@@ -29,7 +29,7 @@ SPIECE_UNDERLINE = "▁"
SAMPLE_VOCAB
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
"fixtures/test_sentencepiece.model"
)
class
Bert
ForSeq
GenerationTokenizationTest
(
TokenizerTesterMixin
,
unittest
.
TestCase
):
class
BertGenerationTokenizationTest
(
TokenizerTesterMixin
,
unittest
.
TestCase
):
tokenizer_class
=
BertGenerationTokenizer
...
...
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