File size: 711 Bytes
541c673
b29a571
 
7f80564
541c673
b29a571
 
541c673
b29a571
541c673
b29a571
 
 
541c673
0373e8d
88ed85e
541c673
 
 
 
 
 
 
 
 
b29a571
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from transformers import PretrainedConfig, HubertConfig

class EmotionClassifierConfig(PretrainedConfig):
    model_type = "hubert"

    def __init__(
        self,
        hidden_size_lstm=128,
        num_classes=6,
        hubert_config=None,
        **kwargs,
    ):
        super().__init__(**kwargs)
        self.hidden_size_lstm = hidden_size_lstm
        self.num_classes = num_classes

        if hubert_config is None:
            # Set default HuBERT configuration
            self.hubert_config = HubertConfig(
                num_attention_heads=16,
                hidden_size=1024,
                num_hidden_layers=24,
            )
        else:
            self.hubert_config = hubert_config