@@ -15,10 +15,6 @@ use tracing_subscriber::{
15
15
16
16
#[ tokio:: main]
17
17
pub async fn main ( ) {
18
- // Set up CPU-aware DLL loading for Windows before any whisper-rs initialization
19
- #[ cfg( target_os = "windows" ) ]
20
- setup_cpu_aware_dll_loading ( ) ;
21
-
22
18
tauri:: async_runtime:: set ( tokio:: runtime:: Handle :: current ( ) ) ;
23
19
24
20
{
@@ -357,7 +353,7 @@ fn create_quit_handler(app_handle: tauri::AppHandle) -> impl Fn() -> bool {
357
353
}
358
354
359
355
fn make_specta_builder < R : tauri:: Runtime > ( ) -> tauri_specta:: Builder < R > {
360
- let mut builder = tauri_specta:: Builder :: < R > :: new ( )
356
+ tauri_specta:: Builder :: < R > :: new ( )
361
357
. commands ( tauri_specta:: collect_commands![
362
358
commands:: sentry_dsn:: <tauri:: Wry >,
363
359
commands:: is_onboarding_needed:: <tauri:: Wry >,
@@ -366,45 +362,8 @@ fn make_specta_builder<R: tauri::Runtime>() -> tauri_specta::Builder<R> {
366
362
commands:: set_autostart:: <tauri:: Wry >,
367
363
commands:: is_individualization_needed:: <tauri:: Wry >,
368
364
commands:: set_individualization_needed:: <tauri:: Wry >,
369
- ] ) ;
370
-
371
- #[ cfg( target_os = "windows" ) ]
372
- {
373
- builder = builder. commands ( tauri_specta:: collect_commands![
374
- commands:: check_cpu_avx_support,
375
- ] ) ;
376
- }
377
-
378
- builder. error_handling ( tauri_specta:: ErrorHandlingMode :: Throw )
379
- }
380
-
381
- /// Set up CPU-aware DLL loading for Windows to ensure compatibility across different systems
382
- #[ cfg( target_os = "windows" ) ]
383
- fn setup_cpu_aware_dll_loading ( ) {
384
- use std:: path:: PathBuf ;
385
- use hypr_whisper_local:: cpu_supports_avx;
386
-
387
- // Select the appropriate DLL file in the same directory as the executable
388
- let dll_filename = if cpu_supports_avx ( ) {
389
- tracing:: info!( "CPU supports AVX2, using optimized whisper DLL" ) ;
390
- "whisper_avx.dll"
391
- } else {
392
- tracing:: info!( "CPU does not support AVX2, using scalar whisper DLL" ) ;
393
- "whisper_scalar.dll"
394
- } ;
395
-
396
- let dll_path = std:: path:: PathBuf :: from ( "./" ) . join ( dll_filename) ;
397
-
398
- // Add the current directory to PATH if the DLL exists
399
- if dll_path. exists ( ) {
400
- let current_path = std:: env:: var ( "PATH" ) . unwrap_or_default ( ) ;
401
- let new_path = format ! ( ".;{}" , current_path) ;
402
- std:: env:: set_var ( "PATH" , new_path) ;
403
-
404
- tracing:: info!( "Updated PATH to include current directory for DLL: {}" , dll_filename) ;
405
- } else {
406
- tracing:: warn!( "DLL file not found: {} - using system defaults" , dll_path. display( ) ) ;
407
- }
365
+ ] )
366
+ . error_handling ( tauri_specta:: ErrorHandlingMode :: Throw )
408
367
}
409
368
410
369
#[ cfg( test) ]
0 commit comments