diff --git a/include/parakeet/api/transcribe.hpp b/include/parakeet/api/transcribe.hpp index b317451..9fbf4ba 100644 --- a/include/parakeet/api/transcribe.hpp +++ b/include/parakeet/api/transcribe.hpp @@ -492,8 +492,12 @@ class Transcriber { /// Enable VAD preprocessing. Call after to_half()/to_gpu(). void enable_vad(const std::string &vad_weights_path) { vad_ = std::make_unique(vad_weights_path); - if (use_fp16_) - vad_->to_half(); + // The VAD deliberately stays fp32 even when the ASR model is fp16. + // SileroVAD::to_half() casts the weights but leaves the context + // buffer, LSTM state and audio input fp32, which aborts the process + // under MPSGraph ('mps.add' requires the same element type). The VAD + // is a ~1.2 MB preprocessor that only emits segment boundaries, so + // running it in fp32 costs almost nothing. if (use_gpu_) vad_->to_gpu(); } @@ -841,8 +845,12 @@ class TDTTranscriber { /// Enable VAD preprocessing. Call after to_half()/to_gpu(). void enable_vad(const std::string &vad_weights_path) { vad_ = std::make_unique(vad_weights_path); - if (use_fp16_) - vad_->to_half(); + // The VAD deliberately stays fp32 even when the ASR model is fp16. + // SileroVAD::to_half() casts the weights but leaves the context + // buffer, LSTM state and audio input fp32, which aborts the process + // under MPSGraph ('mps.add' requires the same element type). The VAD + // is a ~1.2 MB preprocessor that only emits segment boundaries, so + // running it in fp32 costs almost nothing. if (use_gpu_) vad_->to_gpu(); } diff --git a/src/api/diarize.cpp b/src/api/diarize.cpp index 7d46f9d..e3e1b42 100644 --- a/src/api/diarize.cpp +++ b/src/api/diarize.cpp @@ -75,8 +75,8 @@ void DiarizedTranscriber::to_half() { void DiarizedTranscriber::enable_vad(const std::string &vad_weights_path) { vad_ = std::make_unique(vad_weights_path); - if (use_fp16_) - vad_->to_half(); + // See Transcriber::enable_vad — casting the VAD to fp16 mixes an fp32 + // context buffer with fp16 weights and aborts under MPSGraph. if (use_gpu_) vad_->to_gpu(); }