KhaldiAbderrhmane
commited on
Update configuration_emotion_classifier.py
Browse files
configuration_emotion_classifier.py
CHANGED
@@ -1,15 +1,26 @@
|
|
1 |
-
from transformers import PretrainedConfig
|
2 |
|
3 |
class EmotionClassifierConfig(PretrainedConfig):
|
4 |
model_type = "hubert"
|
|
|
5 |
def __init__(
|
6 |
self,
|
7 |
-
hidden_size_lstm
|
8 |
num_classes=6,
|
|
|
9 |
**kwargs,
|
10 |
):
|
11 |
super().__init__(**kwargs)
|
12 |
-
self.hidden_size_lstm = hidden_size_lstm
|
13 |
self.num_classes = num_classes
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
|
|
1 |
+
from transformers import PretrainedConfig, HubertConfig
|
2 |
|
3 |
class EmotionClassifierConfig(PretrainedConfig):
|
4 |
model_type = "hubert"
|
5 |
+
|
6 |
def __init__(
|
7 |
self,
|
8 |
+
hidden_size_lstm=128,
|
9 |
num_classes=6,
|
10 |
+
hubert_config=None,
|
11 |
**kwargs,
|
12 |
):
|
13 |
super().__init__(**kwargs)
|
14 |
+
self.hidden_size_lstm = hidden_size_lstm
|
15 |
self.num_classes = num_classes
|
16 |
|
17 |
+
if hubert_config is None:
|
18 |
+
# Set default HuBERT configuration
|
19 |
+
self.hubert_config = HubertConfig(
|
20 |
+
num_attention_heads=16,
|
21 |
+
hidden_size=1024,
|
22 |
+
num_hidden_layers=24,
|
23 |
+
)
|
24 |
+
else:
|
25 |
+
self.hubert_config = hubert_config
|
26 |
|