AlexHung29629
commited on
Commit
•
375c783
1
Parent(s):
ae4dcca
Update ultravox_processing.py
Browse files- ultravox_processing.py +2 -2
ultravox_processing.py
CHANGED
@@ -152,8 +152,8 @@ class UltravoxProcessor(transformers.ProcessorMixin):
|
|
152 |
def stack_frame_len(T):
|
153 |
T_pad = ((T + self.stack_factor - 1) // self.stack_factor) * self.stack_factor
|
154 |
return int((T_pad + self.stack_factor) // self.stack_factor)
|
155 |
-
nb_encoder_frames =
|
156 |
-
data["audio_token_len"] =
|
157 |
|
158 |
if text is not None:
|
159 |
assert isinstance(
|
|
|
152 |
def stack_frame_len(T):
|
153 |
T_pad = ((T + self.stack_factor - 1) // self.stack_factor) * self.stack_factor
|
154 |
return int((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 |
|
158 |
if text is not None:
|
159 |
assert isinstance(
|