AlexHung29629
commited on
Commit
•
fa9cccb
1
Parent(s):
e11dfd4
Update ultravox_processing.py
Browse files- ultravox_processing.py +1 -1
ultravox_processing.py
CHANGED
@@ -151,7 +151,7 @@ class UltravoxProcessor(transformers.ProcessorMixin):
|
|
151 |
return np.floor((in_len + (2*padding) - (dilation * (kernel - 1)) - 1)/stride + 1)
|
152 |
def stack_frame_len(T):
|
153 |
T_pad = ((T + self.stack_factor - 1) // self.stack_factor) * self.stack_factor
|
154 |
-
return (T_pad + self.stack_factor) // self.stack_factor
|
155 |
nb_encoder_frames = cnn_out_len(cnn_out_len(data["audio_len"], kernel=3), kernel=3, stride=2)
|
156 |
data["audio_token_len"] = stack_frame_len(nb_encoder_frames)
|
157 |
|
|
|
151 |
return np.floor((in_len + (2*padding) - (dilation * (kernel - 1)) - 1)/stride + 1)
|
152 |
def stack_frame_len(T):
|
153 |
T_pad = ((T + self.stack_factor - 1) // self.stack_factor) * self.stack_factor
|
154 |
+
return ((T_pad + self.stack_factor) // self.stack_factor).astype(int)
|
155 |
nb_encoder_frames = cnn_out_len(cnn_out_len(data["audio_len"], kernel=3), kernel=3, stride=2)
|
156 |
data["audio_token_len"] = stack_frame_len(nb_encoder_frames)
|
157 |
|