From 1f7798c7c10dc9e1d3a9caf9bc6973cecdd0ec3e Mon Sep 17 00:00:00 2001 From: Quentin Fuxa Date: Tue, 9 Sep 2025 12:16:52 +0200 Subject: [PATCH] condition on encoder_feature_ctranslate type --- whisperlivekit/simul_whisper/simul_whisper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/whisperlivekit/simul_whisper/simul_whisper.py b/whisperlivekit/simul_whisper/simul_whisper.py index 5707e41..437247d 100644 --- a/whisperlivekit/simul_whisper/simul_whisper.py +++ b/whisperlivekit/simul_whisper/simul_whisper.py @@ -409,6 +409,8 @@ class PaddedAlignAttWhisper: mel_padded_2 = self.fw_feature_extractor(waveform=input_segments.numpy(), padding=N_SAMPLES)[None, :] mel = fw_pad_or_trim(mel_padded_2, N_FRAMES, axis=-1) encoder_feature_ctranslate = self.fw_encoder.encode(mel) + if type(encoder_feature_ctranslate).__module__ == 'ctranslate2._ext': + encoder_feature_ctranslate = np.array(encoder_feature_ctranslate) encoder_feature = torch.as_tensor(encoder_feature_ctranslate, device=self.device) else: # mel + padding to 30s