From 97869d06534904ac61958906f3e2e11b858bda84 Mon Sep 17 00:00:00 2001 From: quake Date: Wed, 21 May 2025 19:23:14 +0900 Subject: [PATCH] fix: try to solve performance issue of macos x86 --- crates/llama/Cargo.toml | 5 ++++- crates/whisper/Cargo.toml | 5 ++++- plugins/local-stt/Cargo.toml | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/llama/Cargo.toml b/crates/llama/Cargo.toml index 23fc54b47..e93260c31 100644 --- a/crates/llama/Cargo.toml +++ b/crates/llama/Cargo.toml @@ -20,9 +20,12 @@ thiserror = { workspace = true } [target.'cfg(not(target_os = "macos"))'.dependencies] llama-cpp-2 = { git = "https://github.com/utilityai/llama-cpp-rs", default-features = false, features = ["openmp", "native"], branch = "update-llama-cpp-2025-04-06" } -[target.'cfg(target_os = "macos")'.dependencies] +[target.'cfg(all(target_os = "macos", target_arch = "aarch64"))'.dependencies] llama-cpp-2 = { git = "https://github.com/utilityai/llama-cpp-rs", features = ["openmp", "native", "metal"], branch = "update-llama-cpp-2025-04-06" } +[target.'cfg(all(target_os = "macos", target_arch = "x86_64"))'.dependencies] +llama-cpp-2 = { git = "https://github.com/utilityai/llama-cpp-rs", features = ["native"], branch = "update-llama-cpp-2025-04-06" } + [dev-dependencies] hypr-buffer = { workspace = true } hypr-data = { workspace = true } diff --git a/crates/whisper/Cargo.toml b/crates/whisper/Cargo.toml index fe7b1f015..2383f169f 100644 --- a/crates/whisper/Cargo.toml +++ b/crates/whisper/Cargo.toml @@ -35,5 +35,8 @@ url = { workspace = true } [target.'cfg(not(target_os = "macos"))'.dependencies] whisper-rs = { git = "https://github.com/tazz4843/whisper-rs", rev = "f5ee632", features = ["raw-api", "tracing_backend"], optional = true } -[target.'cfg(target_os = "macos")'.dependencies] +[target.'cfg(all(target_os = "macos", target_arch = "aarch64"))'.dependencies] whisper-rs = { git = "https://github.com/tazz4843/whisper-rs", rev = "f5ee632", features = ["raw-api", "metal", "tracing_backend"], optional = true } + +[target.'cfg(all(target_os = "macos", target_arch = "x86_64"))'.dependencies] +whisper-rs = { git = "https://github.com/tazz4843/whisper-rs", rev = "f5ee632", features = ["raw-api", "tracing_backend"], optional = true } diff --git a/plugins/local-stt/Cargo.toml b/plugins/local-stt/Cargo.toml index 7bb540e76..84b9733da 100644 --- a/plugins/local-stt/Cargo.toml +++ b/plugins/local-stt/Cargo.toml @@ -53,5 +53,8 @@ tokio-util = { workspace = true } [target.'cfg(not(target_os = "macos"))'.dependencies] kalosm-sound = { workspace = true, default-features = false } -[target.'cfg(target_os = "macos")'.dependencies] +[target.'cfg(all(target_os = "macos", target_arch = "aarch64"))'.dependencies] kalosm-sound = { workspace = true, default-features = false, features = ["metal"] } + +[target.'cfg(all(target_os = "macos", target_arch = "x86_64"))'.dependencies] +kalosm-sound = { workspace = true, default-features = false }