all the custom functions must be in the same file
Browse files
model.py
CHANGED
@@ -10,14 +10,17 @@ from transformers import PretrainedConfig, PreTrainedModel
|
|
10 |
import dac
|
11 |
from audiotools import AudioSignal
|
12 |
|
13 |
-
|
|
|
|
|
|
|
14 |
|
15 |
|
16 |
class DACConfig(PretrainedConfig):
|
17 |
model_type = 'dac'
|
18 |
|
19 |
def __init__(self,
|
20 |
-
model_type_by_sampling_freq:str='
|
21 |
encoding_chunk_size_in_sec:int=1,
|
22 |
decoding_chunk_rate:float=0.1,
|
23 |
decoding_overlap_rate:float=0.1,
|
|
|
10 |
import dac
|
11 |
from audiotools import AudioSignal
|
12 |
|
13 |
+
|
14 |
+
def freeze(model):
|
15 |
+
for param in model.parameters():
|
16 |
+
param.requires_grad = False
|
17 |
|
18 |
|
19 |
class DACConfig(PretrainedConfig):
|
20 |
model_type = 'dac'
|
21 |
|
22 |
def __init__(self,
|
23 |
+
model_type_by_sampling_freq:str='16khz',
|
24 |
encoding_chunk_size_in_sec:int=1,
|
25 |
decoding_chunk_rate:float=0.1,
|
26 |
decoding_overlap_rate:float=0.1,
|
utils.py
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
def freeze(model):
|
4 |
-
for param in model.parameters():
|
5 |
-
param.requires_grad = False
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|