From d32f7a4c4034ca7804f35e1081eb6738414185e3 Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Tue, 2 Jan 2024 16:36:39 -0700 Subject: [PATCH] destutterer doesnt drop stutter for prev --- rust-whisper-baked/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-whisper-baked/src/main.rs b/rust-whisper-baked/src/main.rs index 235854d..6683fce 100644 --- a/rust-whisper-baked/src/main.rs +++ b/rust-whisper-baked/src/main.rs @@ -111,7 +111,7 @@ impl Destutterer { next }; let trailing_punctuation = next[without_trailing_punctuation.len() ..].to_string(); - let next = without_trailing_punctuation; + let next = without_trailing_punctuation.clone(); let next = { let mut n = prev.len().clamp(0, next.len()); while n > 0 { @@ -125,7 +125,7 @@ impl Destutterer { if next.len() == 0 { return "".to_string(); } - self.prev = Some(next.clone()); + self.prev = Some(without_trailing_punctuation); next + &trailing_punctuation }, }