Land release blocker fixes and workspace cleanup
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled

This commit is contained in:
2026-04-23 00:16:09 +01:00
parent d7363cc913
commit 9b0067b4c0
36 changed files with 1529 additions and 418 deletions

View File

@@ -7,13 +7,13 @@ pub mod transcriber;
pub mod whisper_rs_backend;
pub use concurrency::run_inference;
pub use local_engine::{load_parakeet, LocalEngine, SpeechModelAdapter, TimedTranscript};
#[cfg(feature = "whisper")]
pub use local_engine::load_whisper;
pub use local_engine::{load_parakeet, LocalEngine, SpeechModelAdapter, TimedTranscript};
pub use model_manager::{download, is_downloaded, list_downloaded, model_dir, models_dir};
pub use streaming::{
sample_index_for_seconds, trim_buffer_to_commit_point, CommitDecision, CommitPolicy,
LocalAgreement, RmsVadChunker, Token, VadChunk, VadChunker,
};
pub use transcriber::{Transcriber, TranscriberCapabilities};
pub use transcribe_rs::SpeechModel;
pub use transcriber::{Transcriber, TranscriberCapabilities};

View File

@@ -557,7 +557,10 @@ mod tests {
.expect_err("mismatched sha must fail");
let msg = err.to_string();
assert!(msg.contains("SHA256 mismatch"), "unexpected error: {msg}");
assert!(!dest.exists(), ".part → dest rename must not run on mismatch");
assert!(
!dest.exists(),
".part → dest rename must not run on mismatch"
);
let part = dest.with_extension("bin.part");
assert!(!part.exists(), "failed hash must clean up the .part file");
}

View File

@@ -108,11 +108,7 @@ impl LocalAgreement {
// Can't commit anything until we have n passes in hand.
if self.history.len() < self.n {
let tentative = self
.history
.back()
.cloned()
.unwrap_or_default();
let tentative = self.history.back().cloned().unwrap_or_default();
return CommitDecision {
newly_committed: Vec::new(),
tentative,

View File

@@ -121,7 +121,7 @@ impl RmsVadChunker {
pending_onset_frames: 0,
onset_buffer: Vec::new(),
next_sample_index: 0,
active_chunk_start: 0,
active_chunk_start: 0,
}
}
@@ -552,10 +552,7 @@ mod tests {
let mut c = RmsVadChunker::new();
assert!(c.flush().is_empty());
let _ = c.push(&constant_signal(16_000, 0.0));
assert!(
c.flush().is_empty(),
"flushing pure silence emits nothing"
);
assert!(c.flush().is_empty(), "flushing pure silence emits nothing");
}
#[test]

View File

@@ -62,10 +62,9 @@ impl Transcriber for WhisperRsBackend {
"WhisperRsBackend::transcribe_sync entering"
);
let mut state = self
.ctx
.create_state()
.map_err(|e| KonError::TranscriptionFailed(WhisperBackendError::State(e.to_string()).to_string()))?;
let mut state = self.ctx.create_state().map_err(|e| {
KonError::TranscriptionFailed(WhisperBackendError::State(e.to_string()).to_string())
})?;
let mut params = FullParams::new(SamplingStrategy::Greedy { best_of: 1 });
if let Some(lang) = options.language.as_deref() {
@@ -83,9 +82,11 @@ impl Transcriber for WhisperRsBackend {
params.set_print_progress(false);
params.set_print_realtime(false);
state
.full(params, samples)
.map_err(|e| KonError::TranscriptionFailed(WhisperBackendError::Transcribe(e.to_string()).to_string()))?;
state.full(params, samples).map_err(|e| {
KonError::TranscriptionFailed(
WhisperBackendError::Transcribe(e.to_string()).to_string(),
)
})?;
let n = state.full_n_segments();
@@ -96,7 +97,11 @@ impl Transcriber for WhisperRsBackend {
};
let text = seg
.to_str()
.map_err(|e| KonError::TranscriptionFailed(WhisperBackendError::Transcribe(e.to_string()).to_string()))?
.map_err(|e| {
KonError::TranscriptionFailed(
WhisperBackendError::Transcribe(e.to_string()).to_string(),
)
})?
.to_string();
// whisper-rs timestamps are centiseconds (10ms units). Convert to seconds (f64).
let start = seg.start_timestamp() as f64 * 0.01;