rust-whisper-lib imports whisper-burn@432ef86ec1cb9d57406b9fab4e2a13155b10d74b

master
Bel LaPointe 2023-12-21 22:00:51 -05:00
parent 19b0a4b385
commit 5fb1308b30
4 changed files with 3907 additions and 154 deletions

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,7 @@ edition = "2021"
[dependencies]
whisper-rs = { path = "../gitea-whisper-rs", version = "0.8.0" }
whisper = { path = "../whisper-burn", version = "0.1.0", features = ["wgpu-backend"] }
wav = "1"
tokio = "1.27"
byteorder = "1.5.0"

View File

@ -257,6 +257,19 @@ impl Engine {
}
}
struct Engine2 {
}
fn new_engine_2() -> Result<Engine2, String> {
Ok(Engine2{})
}
impl Engine2 {
fn transcribe(&self, data: &Vec<f32>) -> Result<Transcribed, String> {
Err(format!("not impl"))
}
}
struct ATranscribe {
data: Vec<f32>,
ack: Option<std::sync::mpsc::SyncSender<bool>>,
@ -355,4 +368,16 @@ mod tests {
"../gitea-whisper-rs/sys/whisper.cpp/bindings/go/samples/jfk.wav".to_string(),
);
}
#[test]
fn test_transcribe_tiny_jfk_wav_candle() {
let wav_path = "../gitea-whisper-rs/sys/whisper.cpp/bindings/go/samples/jfk.wav".to_string();
let audio_data = f32_from_wav_file(&wav_path).unwrap();
let engine = new_engine_2().unwrap();
let result = engine.transcribe(&audio_data);
assert_eq!(
" And so my fellow Americans ask not what your country can do for you ask what you can do for your country.".to_string(),
result.unwrap().to_string(),
);
}
}

1
whisper-burn Submodule

@ -0,0 +1 @@
Subproject commit 0ee20fbc805d595f14e637503c295f9dc4fa2eb9