5 Commits

Author SHA1 Message Date
Bel LaPointe
1c48026690 need to overlap without ANY puctuation, which i can do by breaking into words 2024-01-02 17:49:47 -07:00
Bel LaPointe
a57312786a gr 2024-01-02 17:48:17 -07:00
Bel LaPointe
55e3bf0a26 update defaults 2024-01-02 17:47:00 -07:00
Bel LaPointe
743c8c5f67 time cargo run -- --wav $HOME/Downloads/41A6C472-6E4D-4953-9A90-2497D2DAD8C9.wav --stream-step 30 --stream-retain 25 --stream-{head,tail}=1 2> /dev/null 2024-01-02 16:45:04 -07:00
Bel LaPointe
d32f7a4c40 destutterer doesnt drop stutter for prev 2024-01-02 16:36:39 -07:00
3 changed files with 7 additions and 6 deletions

View File

@@ -24,6 +24,7 @@ pub fn wav_channel<F>(
handler_fn: F handler_fn: F
) where F: FnMut(Result<rust_whisper_lib::Transcribed, String>) + Send + 'static { ) where F: FnMut(Result<rust_whisper_lib::Transcribed, String>) + Send + 'static {
flags.model_path = None; flags.model_path = None;
flags.model_buffer = Some(include_bytes!("../../models/ggml-distil-medium.en.bin").to_vec());
flags.model_buffer = Some(include_bytes!("../../models/ggml-base.en.bin").to_vec()); flags.model_buffer = Some(include_bytes!("../../models/ggml-base.en.bin").to_vec());
rust_whisper_lib::wav_channel(flags, handler_fn); rust_whisper_lib::wav_channel(flags, handler_fn);
} }

View File

@@ -111,7 +111,7 @@ impl Destutterer {
next next
}; };
let trailing_punctuation = next[without_trailing_punctuation.len() ..].to_string(); let trailing_punctuation = next[without_trailing_punctuation.len() ..].to_string();
let next = without_trailing_punctuation; let next = without_trailing_punctuation.clone();
let next = { let next = {
let mut n = prev.len().clamp(0, next.len()); let mut n = prev.len().clamp(0, next.len());
while n > 0 { while n > 0 {
@@ -125,7 +125,7 @@ impl Destutterer {
if next.len() == 0 { if next.len() == 0 {
return "".to_string(); return "".to_string();
} }
self.prev = Some(next.clone()); self.prev = Some(without_trailing_punctuation);
next + &trailing_punctuation next + &trailing_punctuation
}, },
} }

View File

@@ -14,13 +14,13 @@ pub struct Flags {
#[arg(long, default_value = "8")] #[arg(long, default_value = "8")]
pub threads: i32, pub threads: i32,
#[arg(long, default_value = "5")] #[arg(long, default_value = "30")]
pub stream_step: u64, pub stream_step: u64,
#[arg(long, default_value = "0.6")] #[arg(long, default_value = "28.0")]
pub stream_retain: f32, pub stream_retain: f32,
#[arg(long, default_value = "0.3")] #[arg(long, default_value = "0.1")]
pub stream_head: f32, pub stream_head: f32,
#[arg(long, default_value = "0.3")] #[arg(long, default_value = "0.1")]
pub stream_tail: f32, pub stream_tail: f32,
#[arg(long, default_value = "false")] #[arg(long, default_value = "false")]