Support streaming zipformer CTC (#496)
* Support streaming zipformer CTC * test online zipformer2 CTC * Update doc of sherpa-onnx.cc * Add Python APIs for streaming zipformer2 ctc * Add Python API examples for streaming zipformer2 ctc * Swift API for streaming zipformer2 CTC * NodeJS API for streaming zipformer2 CTC * Kotlin API for streaming zipformer2 CTC * Golang API for streaming zipformer2 CTC * C# API for streaming zipformer2 CTC * Release v1.9.6
This commit is contained in:
@@ -49,12 +49,17 @@ void OnlineCtcGreedySearchDecoder::Decode(
|
||||
|
||||
if (y != blank_id_ && y != prev_id) {
|
||||
r.tokens.push_back(y);
|
||||
r.timestamps.push_back(t);
|
||||
r.timestamps.push_back(t + r.frame_offset);
|
||||
}
|
||||
|
||||
prev_id = y;
|
||||
} // for (int32_t t = 0; t != num_frames; ++t) {
|
||||
} // for (int32_t b = 0; b != batch_size; ++b)
|
||||
|
||||
// Update frame_offset
|
||||
for (auto &r : *results) {
|
||||
r.frame_offset += num_frames;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace sherpa_onnx
|
||||
|
||||
Reference in New Issue
Block a user