diff --git a/Cargo.lock b/Cargo.lock index cddd331..c8fc2f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2793,7 +2793,6 @@ dependencies = [ "base64 0.22.1", "gdk", "gtk", - "libloading 0.8.9", "magnotia-ai-formatting", "magnotia-audio", "magnotia-cloud-providers", @@ -2855,12 +2854,14 @@ name = "magnotia-core" version = "0.1.0" dependencies = [ "async-trait", + "libloading 0.8.9", "num_cpus", "serde", "serde_json", "sysinfo", "tempfile", "thiserror 2.0.18", + "tracing", ] [[package]] diff --git a/crates/transcription/src/whisper_rs_backend.rs b/crates/transcription/src/whisper_rs_backend.rs index 58788a3..3feae74 100644 --- a/crates/transcription/src/whisper_rs_backend.rs +++ b/crates/transcription/src/whisper_rs_backend.rs @@ -10,8 +10,9 @@ use std::path::Path; use whisper_rs::{FullParams, SamplingStrategy, WhisperContext, WhisperContextParameters}; -use magnotia_core::constants::inference_thread_count; use magnotia_core::error::{MagnotiaError, Result}; +use magnotia_core::hardware::vulkan_loader_available; +use magnotia_core::tuning::{inference_thread_count, Workload}; use magnotia_core::types::{Segment, TranscriptionOptions}; use crate::transcriber::{Transcriber, TranscriberCapabilities}; @@ -78,7 +79,8 @@ impl Transcriber for WhisperRsBackend { params.set_initial_prompt(prompt); } } - params.set_n_threads(inference_thread_count() as i32); + let gpu_offloaded = cfg!(feature = "whisper-vulkan") && vulkan_loader_available(); + params.set_n_threads(inference_thread_count(Workload::Whisper, gpu_offloaded) as i32); params.set_print_special(false); params.set_print_progress(false); params.set_print_realtime(false);