Skip to content

Commit 5a58f1a

Browse files
ArthurZuckerBernardZach
authored andcommitted
[Deberta/Deberta-v2] Refactor code base to support compile, export, and fix LLM (huggingface#22105)
* some modification for roadmap * revert some changes * yups * weird * make it work * sttling * fix-copies * fixup * renaming * more fix-copies * move stuff around * remove torch script warnings * ignore copies * revert bad changes * woops * just styling * nit * revert * style fixup * nits configuration style * fixup * nits * will this fix the tf pt issue? * style * ??????? * update * eval? * update error message * updates * style * grumble grumble * update * style * nit * skip torch fx tests that were failing * style * skip the failing tests * skip another test and make style
1 parent 23ce801 commit 5a58f1a

10 files changed

+1009
-1191
lines changed

src/transformers/models/deberta/configuration_deberta.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ class DebertaConfig(PretrainedConfig):
8282
`["p2c", "c2p"]`.
8383
layer_norm_eps (`float`, *optional*, defaults to 1e-12):
8484
The epsilon used by the layer normalization layers.
85+
legacy (`bool`, *optional*, defaults to `True`):
86+
Whether or not the model should use the legacy `LegacyDebertaOnlyMLMHead`, which does not work properly
87+
for mask infilling tasks.
8588
8689
Example:
8790
@@ -121,6 +124,7 @@ def __init__(
121124
pos_att_type=None,
122125
pooler_dropout=0,
123126
pooler_hidden_act="gelu",
127+
legacy=True,
124128
**kwargs,
125129
):
126130
super().__init__(**kwargs)
@@ -151,6 +155,7 @@ def __init__(
151155
self.pooler_hidden_size = kwargs.get("pooler_hidden_size", hidden_size)
152156
self.pooler_dropout = pooler_dropout
153157
self.pooler_hidden_act = pooler_hidden_act
158+
self.legacy = legacy
154159

155160

156161
# Copied from transformers.models.deberta_v2.configuration_deberta_v2.DebertaV2OnnxConfig

0 commit comments

Comments
 (0)