Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions include/parakeet/api/transcribe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<audio::SileroVAD>(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();
}
Expand Down Expand Up @@ -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<audio::SileroVAD>(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();
}
Expand Down
4 changes: 2 additions & 2 deletions src/api/diarize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ void DiarizedTranscriber::to_half() {

void DiarizedTranscriber::enable_vad(const std::string &vad_weights_path) {
vad_ = std::make_unique<audio::SileroVAD>(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();
}
Expand Down