Commit
•
3746216
1
Parent(s):
cc3dabb
Update modeling_ltgbert.py (#1)
Browse files- Update modeling_ltgbert.py (0d621b732be7b6ff549810a1abdf5f77747193b3)
Co-authored-by: Koichi Yasuoka <KoichiYasuoka@users.noreply.huggingface.co>
- modeling_ltgbert.py +4 -2
modeling_ltgbert.py
CHANGED
@@ -252,8 +252,10 @@ class LtgbertPreTrainedModel(PreTrainedModel):
|
|
252 |
elif isinstance(module, nn.Embedding):
|
253 |
nn.init.trunc_normal_(module.weight.data, mean=0.0, std=std, a=-2*std, b=2*std)
|
254 |
elif isinstance(module, nn.LayerNorm):
|
255 |
-
module.bias
|
256 |
-
|
|
|
|
|
257 |
|
258 |
|
259 |
class LtgbertModel(LtgbertPreTrainedModel):
|
|
|
252 |
elif isinstance(module, nn.Embedding):
|
253 |
nn.init.trunc_normal_(module.weight.data, mean=0.0, std=std, a=-2*std, b=2*std)
|
254 |
elif isinstance(module, nn.LayerNorm):
|
255 |
+
if module.bias is not None:
|
256 |
+
module.bias.data.zero_()
|
257 |
+
if module.weight is not None:
|
258 |
+
module.weight.data.fill_(1.0)
|
259 |
|
260 |
|
261 |
class LtgbertModel(LtgbertPreTrainedModel):
|