Remove extraneous logging
This commit is contained in:
parent
8381b9f48e
commit
aef7699734
3 changed files with 6 additions and 2 deletions
1
src-tauri/Cargo.lock
generated
1
src-tauri/Cargo.lock
generated
|
|
@ -5529,6 +5529,7 @@ version = "0.13.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "40b6fc553156b521663bfa8e713e7ad58c7ca262d46de9998cd7f2e4de5ba0d9"
|
checksum = "40b6fc553156b521663bfa8e713e7ad58c7ca262d46de9998cd7f2e4de5ba0d9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"log",
|
||||||
"whisper-rs-sys",
|
"whisper-rs-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ tauri-plugin-clipboard-manager = "2"
|
||||||
tauri-plugin-macos-permissions = "2.0.4"
|
tauri-plugin-macos-permissions = "2.0.4"
|
||||||
rdev = { git = "https://github.com/rustdesk-org/rdev" }
|
rdev = { git = "https://github.com/rustdesk-org/rdev" }
|
||||||
cpal = "0.15.3"
|
cpal = "0.15.3"
|
||||||
whisper-rs = { version = "0.13.2" }
|
whisper-rs = { version = "0.13.2", features = ["whisper-cpp-log"] }
|
||||||
anyhow = "1.0.95"
|
anyhow = "1.0.95"
|
||||||
rubato = "0.16.1"
|
rubato = "0.16.1"
|
||||||
samplerate = "0.2.4"
|
samplerate = "0.2.4"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
use whisper_rs::install_whisper_log_trampoline;
|
||||||
use whisper_rs::{
|
use whisper_rs::{
|
||||||
FullParams, SamplingStrategy, WhisperContext, WhisperContextParameters, WhisperState,
|
FullParams, SamplingStrategy, WhisperContext, WhisperContextParameters, WhisperState,
|
||||||
};
|
};
|
||||||
|
|
@ -11,6 +12,7 @@ pub struct TranscriptionManager {
|
||||||
|
|
||||||
impl TranscriptionManager {
|
impl TranscriptionManager {
|
||||||
pub fn new() -> Result<Self> {
|
pub fn new() -> Result<Self> {
|
||||||
|
install_whisper_log_trampoline();
|
||||||
// Load the model
|
// Load the model
|
||||||
let context = WhisperContext::new_with_params(
|
let context = WhisperContext::new_with_params(
|
||||||
"resources/ggml-small.bin",
|
"resources/ggml-small.bin",
|
||||||
|
|
@ -33,7 +35,7 @@ impl TranscriptionManager {
|
||||||
let mut result = String::new();
|
let mut result = String::new();
|
||||||
println!("Audio vector length: {}", audio.len());
|
println!("Audio vector length: {}", audio.len());
|
||||||
|
|
||||||
if (audio.len() == 0) {
|
if audio.len() == 0 {
|
||||||
println!("Empty audio vector");
|
println!("Empty audio vector");
|
||||||
// TODO error
|
// TODO error
|
||||||
return Ok(result);
|
return Ok(result);
|
||||||
|
|
@ -46,6 +48,7 @@ impl TranscriptionManager {
|
||||||
params.set_print_progress(false);
|
params.set_print_progress(false);
|
||||||
params.set_print_realtime(false);
|
params.set_print_realtime(false);
|
||||||
params.set_print_timestamps(false);
|
params.set_print_timestamps(false);
|
||||||
|
params.set_suppress_non_speech_tokens(true);
|
||||||
|
|
||||||
state
|
state
|
||||||
.full(params, &audio)
|
.full(params, &audio)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue