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
7511f3dd
Commit
7511f3dd
authored
Jan 20, 2020
by
Lysandre
Committed by
Lysandre Debut
Jan 23, 2020
Browse files
PyTorch CTRL + Style
parent
980211a6
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
14 deletions
+6
-14
src/transformers/modeling_xlm.py
src/transformers/modeling_xlm.py
+0
-5
src/transformers/modeling_xlm_roberta.py
src/transformers/modeling_xlm_roberta.py
+6
-2
src/transformers/modeling_xlnet.py
src/transformers/modeling_xlnet.py
+0
-7
No files found.
src/transformers/modeling_xlm.py
View file @
7511f3dd
...
...
@@ -317,7 +317,6 @@ XLM_INPUTS_DOCSTRING = r"""
XLM_START_DOCSTRING
,
)
class
XLMModel
(
XLMPreTrainedModel
):
def
__init__
(
self
,
config
):
# , dico, is_encoder, with_output):
super
().
__init__
(
config
)
self
.
output_attentions
=
config
.
output_attentions
...
...
@@ -620,7 +619,6 @@ class XLMPredLayer(nn.Module):
XLM_START_DOCSTRING
,
)
class
XLMWithLMHeadModel
(
XLMPreTrainedModel
):
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
self
.
transformer
=
XLMModel
(
config
)
...
...
@@ -718,7 +716,6 @@ class XLMWithLMHeadModel(XLMPreTrainedModel):
XLM_START_DOCSTRING
,
)
class
XLMForSequenceClassification
(
XLMPreTrainedModel
):
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
self
.
num_labels
=
config
.
num_labels
...
...
@@ -813,7 +810,6 @@ class XLMForSequenceClassification(XLMPreTrainedModel):
XLM_START_DOCSTRING
,
)
class
XLMForQuestionAnsweringSimple
(
XLMPreTrainedModel
):
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
...
...
@@ -929,7 +925,6 @@ class XLMForQuestionAnsweringSimple(XLMPreTrainedModel):
XLM_START_DOCSTRING
,
)
class
XLMForQuestionAnswering
(
XLMPreTrainedModel
):
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
...
...
src/transformers/modeling_xlm_roberta.py
View file @
7511f3dd
...
...
@@ -61,19 +61,20 @@ class XLMRobertaModel(RobertaModel):
This class overrides :class:`~transformers.RobertaModel`. Please check the
superclass for the appropriate documentation alongside usage examples.
"""
config_class
=
XLMRobertaConfig
pretrained_model_archive_map
=
XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_MAP
@
add_start_docstrings
(
"""XLM-RoBERTa Model with a `language modeling` head on top. """
,
XLM_ROBERTA_START_DOCSTRING
,
"""XLM-RoBERTa Model with a `language modeling` head on top. """
,
XLM_ROBERTA_START_DOCSTRING
,
)
class
XLMRobertaForMaskedLM
(
RobertaForMaskedLM
):
"""
This class overrides :class:`~transformers.RobertaForMaskedLM`. Please check the
superclass for the appropriate documentation alongside usage examples.
"""
config_class
=
XLMRobertaConfig
pretrained_model_archive_map
=
XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_MAP
...
...
@@ -88,6 +89,7 @@ class XLMRobertaForSequenceClassification(RobertaForSequenceClassification):
This class overrides :class:`~transformers.RobertaForSequenceClassification`. Please check the
superclass for the appropriate documentation alongside usage examples.
"""
config_class
=
XLMRobertaConfig
pretrained_model_archive_map
=
XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_MAP
...
...
@@ -102,6 +104,7 @@ class XLMRobertaForMultipleChoice(RobertaForMultipleChoice):
This class overrides :class:`~transformers.RobertaForMultipleChoice`. Please check the
superclass for the appropriate documentation alongside usage examples.
"""
config_class
=
XLMRobertaConfig
pretrained_model_archive_map
=
XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_MAP
...
...
@@ -116,5 +119,6 @@ class XLMRobertaForTokenClassification(RobertaForTokenClassification):
This class overrides :class:`~transformers.RobertaForTokenClassification`. Please check the
superclass for the appropriate documentation alongside usage examples.
"""
config_class
=
XLMRobertaConfig
pretrained_model_archive_map
=
XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_MAP
src/transformers/modeling_xlnet.py
View file @
7511f3dd
...
...
@@ -575,7 +575,6 @@ XLNET_INPUTS_DOCSTRING = r"""
XLNET_START_DOCSTRING
,
)
class
XLNetModel
(
XLNetPreTrainedModel
):
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
self
.
output_attentions
=
config
.
output_attentions
...
...
@@ -929,7 +928,6 @@ class XLNetModel(XLNetPreTrainedModel):
XLNET_START_DOCSTRING
,
)
class
XLNetLMHeadModel
(
XLNetPreTrainedModel
):
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
self
.
attn_type
=
config
.
attn_type
...
...
@@ -1060,7 +1058,6 @@ class XLNetLMHeadModel(XLNetPreTrainedModel):
XLNET_START_DOCSTRING
,
)
class
XLNetForSequenceClassification
(
XLNetPreTrainedModel
):
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
self
.
num_labels
=
config
.
num_labels
...
...
@@ -1161,7 +1158,6 @@ class XLNetForSequenceClassification(XLNetPreTrainedModel):
XLNET_START_DOCSTRING
,
)
class
XLNetForTokenClassification
(
XLNetPreTrainedModel
):
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
self
.
num_labels
=
config
.
num_labels
...
...
@@ -1262,7 +1258,6 @@ class XLNetForTokenClassification(XLNetPreTrainedModel):
XLNET_START_DOCSTRING
,
)
class
XLNetForMultipleChoice
(
XLNetPreTrainedModel
):
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
...
...
@@ -1369,7 +1364,6 @@ class XLNetForMultipleChoice(XLNetPreTrainedModel):
XLNET_START_DOCSTRING
,
)
class
XLNetForQuestionAnsweringSimple
(
XLNetPreTrainedModel
):
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
self
.
num_labels
=
config
.
num_labels
...
...
@@ -1486,7 +1480,6 @@ class XLNetForQuestionAnsweringSimple(XLNetPreTrainedModel):
XLNET_START_DOCSTRING
,
)
class
XLNetForQuestionAnswering
(
XLNetPreTrainedModel
):
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
self
.
start_n_top
=
config
.
start_n_top
...
...
Prev
1
2
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