Skip to content

Commit 2ec859c

Browse files
authored
Refactor with continuous VAD stream + AI bump (#1358)
1 parent 285784d commit 2ec859c

File tree

17 files changed

+364
-256
lines changed

17 files changed

+364
-256
lines changed

Cargo.lock

Lines changed: 33 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ hypr-calendar-apple = { path = "crates/calendar-apple", package = "calendar-appl
3232
hypr-calendar-google = { path = "crates/calendar-google", package = "calendar-google" }
3333
hypr-calendar-interface = { path = "crates/calendar-interface", package = "calendar-interface" }
3434
hypr-calendar-outlook = { path = "crates/calendar-outlook", package = "calendar-outlook" }
35-
hypr-chunker = { path = "crates/chunker", package = "chunker" }
3635
hypr-clova = { path = "crates/clova", package = "clova" }
3736
hypr-data = { path = "crates/data", package = "data" }
3837
hypr-db-admin = { path = "crates/db-admin", package = "db-admin" }
@@ -72,6 +71,7 @@ hypr-transcribe-moonshine = { path = "crates/transcribe-moonshine", package = "t
7271
hypr-transcribe-openai = { path = "crates/transcribe-openai", package = "transcribe-openai" }
7372
hypr-transcribe-whisper-local = { path = "crates/transcribe-whisper-local", package = "transcribe-whisper-local" }
7473
hypr-turso = { path = "crates/turso", package = "turso" }
74+
hypr-vad = { path = "crates/vad", package = "vad" }
7575
hypr-whisper = { path = "crates/whisper", package = "whisper" }
7676
hypr-whisper-local = { path = "crates/whisper-local", package = "whisper-local" }
7777
hypr-whisper-local-model = { path = "crates/whisper-local-model", package = "whisper-local-model" }

crates/chunker/src/chunker.rs

Lines changed: 0 additions & 144 deletions
This file was deleted.

crates/chunker/src/lib.rs

Lines changed: 0 additions & 5 deletions
This file was deleted.

crates/llama/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ openmp = ["llama-cpp-2/openmp"]
1616
hypr-gguf = { workspace = true }
1717

1818
encoding_rs = "0.8.35"
19-
llama-cpp-2 = { git = "https://github.com/utilityai/llama-cpp-rs", default-features = false, branch = "update-llama-cpp-2025-07-16" }
20-
llama-cpp-sys-2 = { git = "https://github.com/utilityai/llama-cpp-rs", default-features = false, branch = "update-llama-cpp-2025-07-16" }
19+
llama-cpp-2 = { git = "https://github.com/utilityai/llama-cpp-rs", default-features = false, branch = "update-llama-cpp-2025-08-16" }
20+
llama-cpp-sys-2 = { git = "https://github.com/utilityai/llama-cpp-rs", default-features = false, branch = "update-llama-cpp-2025-08-16" }
2121

2222
async-openai = { workspace = true }
2323
futures-util = { workspace = true }

crates/transcribe-moonshine/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ owhisper-config = { workspace = true }
1515
owhisper-interface = { workspace = true }
1616

1717
hypr-audio-utils = { workspace = true }
18-
hypr-chunker = { workspace = true }
18+
hypr-vad = { workspace = true }
1919
hypr-ws-utils = { workspace = true }
2020

2121
serde = { workspace = true, features = ["derive"] }

crates/transcribe-moonshine/src/service/streaming.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use axum::{
1717
use futures_util::{SinkExt, StreamExt};
1818
use tower::Service;
1919

20-
use hypr_chunker::VadExt;
2120
use hypr_moonshine::MoonshineOnnxModel;
21+
use hypr_vad::VadExt;
2222

2323
use owhisper_config::MoonshineModelSize;
2424
use owhisper_interface::{Alternatives, Channel, ListenParams, Metadata, StreamResponse, Word};
@@ -171,7 +171,7 @@ async fn handle_single_channel(
171171
redemption_time: Duration,
172172
) {
173173
let audio_source = hypr_ws_utils::WebSocketAudioSource::new(ws_receiver, 16 * 1000);
174-
let vad_chunks = audio_source.vad_chunks(redemption_time);
174+
let vad_chunks = audio_source.speech_chunks(redemption_time);
175175

176176
let stream = process_vad_stream(vad_chunks, model, "mixed");
177177
let boxed_stream = Box::pin(stream);
@@ -188,12 +188,12 @@ async fn handle_dual_channel(
188188
hypr_ws_utils::split_dual_audio_sources(ws_receiver, 16 * 1000);
189189

190190
let mic_stream = {
191-
let mic_vad_chunks = mic_source.vad_chunks(redemption_time);
191+
let mic_vad_chunks = mic_source.speech_chunks(redemption_time);
192192
process_vad_stream(mic_vad_chunks, model.clone(), "mic")
193193
};
194194

195195
let speaker_stream = {
196-
let speaker_vad_chunks = speaker_source.vad_chunks(redemption_time);
196+
let speaker_vad_chunks = speaker_source.speech_chunks(redemption_time);
197197
process_vad_stream(speaker_vad_chunks, model.clone(), "speaker")
198198
};
199199

@@ -223,7 +223,7 @@ fn process_vad_stream<S, E>(
223223
source_name: &str,
224224
) -> impl futures_util::Stream<Item = StreamResponse>
225225
where
226-
S: futures_util::Stream<Item = Result<hypr_chunker::AudioChunk, E>>,
226+
S: futures_util::Stream<Item = Result<hypr_vad::AudioChunk, E>>,
227227
E: std::fmt::Display,
228228
{
229229
let source_name = source_name.to_string();

crates/transcribe-whisper-local/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ owhisper-client = { workspace = true }
2323

2424
[dependencies]
2525
hypr-audio-utils = { workspace = true }
26-
hypr-chunker = { workspace = true }
2726
hypr-pyannote-local = { workspace = true }
27+
hypr-vad = { workspace = true }
2828
hypr-whisper = { workspace = true }
2929
hypr-whisper-local = { workspace = true }
3030
hypr-ws-utils = { workspace = true }

0 commit comments

Comments
 (0)