Compare commits
2 Commits
a8c8140d18
...
9bc009996c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9bc009996c | ||
|
|
cbc8a4f9fd |
@@ -33,7 +33,7 @@ pub fn f32_from_wav_file(path: &String) -> Result<Vec<f32>, String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_fast() -> Vec<u8> {
|
fn get_fast() -> Vec<u8> {
|
||||||
include_bytes!("../../models/ggml-base.en.bin").to_vec()
|
include_bytes!("../../models/ggml-small.en.bin").to_vec()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_good() -> Vec<u8> {
|
fn get_good() -> Vec<u8> {
|
||||||
|
|||||||
@@ -48,11 +48,15 @@ fn channel(flags: rust_whisper_lib::Flags) {
|
|||||||
|
|
||||||
eprintln!("rust whisper baked lib channel...");
|
eprintln!("rust whisper baked lib channel...");
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
|
let mut w = new_destutterer();
|
||||||
rust_whisper_baked_lib::channel(
|
rust_whisper_baked_lib::channel(
|
||||||
flags.clone(),
|
flags.clone(),
|
||||||
|result: Result<rust_whisper_lib::Transcribed, String>| {
|
move |result: Result<rust_whisper_lib::Transcribed, String>| {
|
||||||
match result {
|
match result {
|
||||||
Ok(transcribed) => { println!("{}", transcribed.to_string()); },
|
Ok(transcribed) => {
|
||||||
|
let s = w.step(transcribed.to_string());
|
||||||
|
println!("{}", s);
|
||||||
|
},
|
||||||
Err(msg) => { eprintln!("error: {}", msg); },
|
Err(msg) => { eprintln!("error: {}", msg); },
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -98,7 +102,7 @@ impl Destutterer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let next_words = Words::from_string(next.clone());
|
let next_words = Words::from_string(next.clone());
|
||||||
let mut n = self.prev.to_comparable_words().len().clamp(0, next_words.to_comparable_words().len());
|
let mut n = self.prev.comparable_len().clamp(0, next_words.comparable_len());
|
||||||
//println!("n={} prev='{:?}' next='{:?}'", n, self.prev.to_comparable_words(), next_words.to_comparable_words());
|
//println!("n={} prev='{:?}' next='{:?}'", n, self.prev.to_comparable_words(), next_words.to_comparable_words());
|
||||||
while n > 0 {
|
while n > 0 {
|
||||||
let (prev_s, _) = self.prev.last_n_comparable_to_string(n);
|
let (prev_s, _) = self.prev.last_n_comparable_to_string(n);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
todo:
|
todo:
|
||||||
|
- whisper trims outside silence so head and tail never get hit
|
||||||
- split on silence-ish instead of duration
|
- split on silence-ish instead of duration
|
||||||
- rust-whisper warn when transcription time ~ input time
|
- rust-whisper warn when transcription time ~ input time
|
||||||
scheduled: []
|
scheduled: []
|
||||||
|
|||||||
Reference in New Issue
Block a user