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
ce9eade2
"...git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "b168b0161987e95f9571c6fdaaef448c03ac396c"
Commit
ce9eade2
authored
Oct 30, 2019
by
Lysandre
Committed by
Lysandre Debut
Nov 26, 2019
Browse files
Initializer range using BertPreTrainedModel
parent
5680a110
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
transformers/modeling_albert.py
transformers/modeling_albert.py
+2
-3
No files found.
transformers/modeling_albert.py
View file @
ce9eade2
...
@@ -6,8 +6,7 @@ import torch
...
@@ -6,8 +6,7 @@ import torch
import
torch.nn
as
nn
import
torch.nn
as
nn
from
torch.nn
import
CrossEntropyLoss
from
torch.nn
import
CrossEntropyLoss
from
transformers.configuration_albert
import
AlbertConfig
from
transformers.configuration_albert
import
AlbertConfig
from
transformers.modeling_bert
import
BertEmbeddings
,
BertModel
,
BertSelfAttention
,
prune_linear_layer
,
ACT2FN
from
transformers.modeling_bert
import
BertEmbeddings
,
BertPreTrainedModel
,
BertModel
,
BertSelfAttention
,
prune_linear_layer
,
ACT2FN
from
transformers.modeling_utils
import
PreTrainedModel
from
.file_utils
import
add_start_docstrings
from
.file_utils
import
add_start_docstrings
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -362,7 +361,7 @@ class AlbertModel(BertModel):
...
@@ -362,7 +361,7 @@ class AlbertModel(BertModel):
@
add_start_docstrings
(
"Bert Model with a `language modeling` head on top."
,
ALBERT_START_DOCSTRING
,
ALBERT_INPUTS_DOCSTRING
)
@
add_start_docstrings
(
"Bert Model with a `language modeling` head on top."
,
ALBERT_START_DOCSTRING
,
ALBERT_INPUTS_DOCSTRING
)
class
AlbertForMaskedLM
(
PreTrainedModel
):
class
AlbertForMaskedLM
(
Bert
PreTrainedModel
):
r
"""
r
"""
**masked_lm_labels**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
**masked_lm_labels**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
Labels for computing the masked language modeling loss.
Labels for computing the masked language modeling loss.
...
...
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