Arsh9210 commited on
Commit
46fba21
·
verified ·
1 Parent(s): 258c72d

Added audex_causal_speech_decoder/configuration_audex_causal_speech_decoder.py

Browse files
audex_causal_speech_decoder/configuration_audex_causal_speech_decoder.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ from __future__ import annotations
16
+
17
+ from transformers import PretrainedConfig
18
+
19
+
20
+ class AudexCausalSpeechDecoderConfig(PretrainedConfig):
21
+ model_type = "audex_causal_speech_decoder"
22
+
23
+ def __init__(
24
+ self,
25
+ hidden_dim: int = 2048,
26
+ depth: int = 12,
27
+ heads: int = 32,
28
+ pos_meb_dim: int = 64,
29
+ hop_length: int = 320,
30
+ vq_dim: int = 2048,
31
+ lookahead_steps: int = 4,
32
+ sample_rate: int = 16000,
33
+ codebook_levels: list[int] | None = None,
34
+ codebook_size: int = 65536,
35
+ token_embed_dim: int = 8,
36
+ embed_tokens_from_codes: bool = True,
37
+ **kwargs,
38
+ ):
39
+ super().__init__(**kwargs)
40
+ self.hidden_dim = hidden_dim
41
+ self.depth = depth
42
+ self.heads = heads
43
+ self.pos_meb_dim = pos_meb_dim
44
+ self.hop_length = hop_length
45
+ self.vq_dim = vq_dim
46
+ self.lookahead_steps = lookahead_steps
47
+ self.sample_rate = sample_rate
48
+ self.codebook_levels = codebook_levels or [4, 4, 4, 4, 4, 4, 4, 4]
49
+ self.codebook_size = codebook_size
50
+ self.token_embed_dim = token_embed_dim
51
+ self.embed_tokens_from_codes = embed_tokens_from_codes