File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
paddlenlp/transformers/ernie_m Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ def __init__(
160160 max_position_embeddings : int = 514 ,
161161 type_vocab_size : int = 16 ,
162162 initializer_range : float = 0.02 ,
163- pad_token_id : int = 0 ,
163+ pad_token_id : int = 1 ,
164164 ** kwargs
165165 ):
166166 super ().__init__ (pad_token_id = pad_token_id , ** kwargs )
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ def forward(
278278
279279 if attention_mask is None :
280280 attention_mask = paddle .unsqueeze (
281- (input_ids == 0 ).astype (self .pooler .dense .weight .dtype ) * - 1e4 , axis = [1 , 2 ]
281+ (input_ids == self . pad_token_id ).astype (self .pooler .dense .weight .dtype ) * - 1e4 , axis = [1 , 2 ]
282282 )
283283 if past_key_values is not None :
284284 batch_size = past_key_values [0 ][0 ].shape [0 ]
You can’t perform that action at this time.
0 commit comments