Upload EncT5ForSequenceClassification
Browse files- README.md +3 -4
- config.json +1 -0
- configuration_enct5.py +3 -0
- model.safetensors +2 -2
- modeling_enct5.py +1 -1
README.md
CHANGED
@@ -1,14 +1,13 @@
|
|
1 |
---
|
2 |
-
language:
|
3 |
- en
|
4 |
- fr
|
5 |
- ro
|
6 |
- de
|
|
|
|
|
7 |
datasets:
|
8 |
- c4
|
9 |
-
library_name: transformers
|
10 |
-
|
11 |
-
license: apache-2.0
|
12 |
---
|
13 |
|
14 |
# Model Card for EncT5
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
- en
|
4 |
- fr
|
5 |
- ro
|
6 |
- de
|
7 |
+
license: apache-2.0
|
8 |
+
library_name: transformers
|
9 |
datasets:
|
10 |
- c4
|
|
|
|
|
|
|
11 |
---
|
12 |
|
13 |
# Model Card for EncT5
|
config.json
CHANGED
@@ -59,6 +59,7 @@
|
|
59 |
"prefix": "translate English to Romanian: "
|
60 |
}
|
61 |
},
|
|
|
62 |
"torch_dtype": "float32",
|
63 |
"transformers_version": "4.37.1",
|
64 |
"use_cache": true,
|
|
|
59 |
"prefix": "translate English to Romanian: "
|
60 |
}
|
61 |
},
|
62 |
+
"tie_word_embeddings": false,
|
63 |
"torch_dtype": "float32",
|
64 |
"transformers_version": "4.37.1",
|
65 |
"use_cache": true,
|
configuration_enct5.py
CHANGED
@@ -131,3 +131,6 @@ class EncT5Config(PretrainedConfig):
|
|
131 |
is_encoder_decoder=is_encoder_decoder,
|
132 |
**kwargs,
|
133 |
)
|
|
|
|
|
|
|
|
131 |
is_encoder_decoder=is_encoder_decoder,
|
132 |
**kwargs,
|
133 |
)
|
134 |
+
|
135 |
+
# Override the default behavior to tie word embeddings.
|
136 |
+
self.tie_word_embeddings = False
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1e9cc0194fa5bfc256b2e2d47affe664f166cdaf29430947220e1606223691cc
|
3 |
+
size 476301088
|
modeling_enct5.py
CHANGED
@@ -93,7 +93,6 @@ class EncT5ForSequenceClassification(EncT5PreTrainedModel):
|
|
93 |
|
94 |
# Initiate decoder embedding from scratch and define the corresponding latent vector vocabulary size.
|
95 |
self.decoder_embeddings = nn.Embedding(config.decoder_vocab_size, config.d_model)
|
96 |
-
self.transformer.get_decoder().set_input_embeddings(self.decoder_embeddings)
|
97 |
|
98 |
# Initiate decoder projection head from scratch.
|
99 |
if config.problem_type == "multi_label_classification":
|
@@ -115,6 +114,7 @@ class EncT5ForSequenceClassification(EncT5PreTrainedModel):
|
|
115 |
Prepares the model for fine-tuning by re-initializing the necessary weights for fine-tuning. This step should be
|
116 |
performed after loading the pre-trained T5 model but before fine-tuning.
|
117 |
"""
|
|
|
118 |
self.transformer.get_decoder().apply(self._init_weights)
|
119 |
self._init_weights(self.classification_head)
|
120 |
|
|
|
93 |
|
94 |
# Initiate decoder embedding from scratch and define the corresponding latent vector vocabulary size.
|
95 |
self.decoder_embeddings = nn.Embedding(config.decoder_vocab_size, config.d_model)
|
|
|
96 |
|
97 |
# Initiate decoder projection head from scratch.
|
98 |
if config.problem_type == "multi_label_classification":
|
|
|
114 |
Prepares the model for fine-tuning by re-initializing the necessary weights for fine-tuning. This step should be
|
115 |
performed after loading the pre-trained T5 model but before fine-tuning.
|
116 |
"""
|
117 |
+
self.transformer.get_decoder().set_input_embeddings(self.decoder_embeddings)
|
118 |
self.transformer.get_decoder().apply(self._init_weights)
|
119 |
self._init_weights(self.classification_head)
|
120 |
|