From 5b5b1afe42a59198f79538c69182e19b427caf60 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Sun, 22 Jun 2025 18:37:12 +0900 Subject: [PATCH 1/8] wip --- crates/llama/Cargo.toml | 18 +-- crates/whisper/src/local/model.rs | 3 + plugins/local-llm/Cargo.toml | 7 ++ scripts/pre_build.py | 187 ++++++++++++++++++++++++++++++ 4 files changed, 206 insertions(+), 9 deletions(-) create mode 100644 scripts/pre_build.py diff --git a/crates/llama/Cargo.toml b/crates/llama/Cargo.toml index eb7ac33c93..a905a14e18 100644 --- a/crates/llama/Cargo.toml +++ b/crates/llama/Cargo.toml @@ -3,11 +3,20 @@ name = "llama" version = "0.1.0" edition = "2021" +# https://github.com/utilityai/llama-cpp-rs/blob/update-llama-cpp-2025-05-28/llama-cpp-2/Cargo.toml +[features] +default = [] +metal = ["llama-cpp-2/metal"] +cuda = ["llama-cpp-2/cuda"] +vulkan = ["llama-cpp-2/vulkan"] +native = ["llama-cpp-2/native"] + [dependencies] hypr-gguf = { workspace = true } encoding_rs = "0.8.35" gbnf-validator = { workspace = true } +llama-cpp-2 = { git = "https://github.com/utilityai/llama-cpp-rs", default-features = false, branch = "update-llama-cpp-2025-05-28" } async-openai = { workspace = true } futures-util = { workspace = true } @@ -18,15 +27,6 @@ tracing = { workspace = true } serde = { workspace = true } 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"], branch = "update-llama-cpp-2025-05-28" } - -[target.'cfg(all(target_os = "macos", target_arch = "aarch64"))'.dependencies] -llama-cpp-2 = { git = "https://github.com/utilityai/llama-cpp-rs", features = ["openmp", "metal"], branch = "update-llama-cpp-2025-05-28" } - -[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-05-28" } - [dev-dependencies] hypr-buffer = { workspace = true } hypr-data = { workspace = true } diff --git a/crates/whisper/src/local/model.rs b/crates/whisper/src/local/model.rs index 88782f1518..5aa7c17f31 100644 --- a/crates/whisper/src/local/model.rs +++ b/crates/whisper/src/local/model.rs @@ -46,6 +46,9 @@ impl WhisperBuilder { let context_param = { let mut p = WhisperContextParameters::default(); + p.gpu_device = 0; + p.use_gpu = true; + p.flash_attn = true; p.dtw_parameters.mode = whisper_rs::DtwMode::None; p }; diff --git a/plugins/local-llm/Cargo.toml b/plugins/local-llm/Cargo.toml index abd50422db..4acb44487a 100644 --- a/plugins/local-llm/Cargo.toml +++ b/plugins/local-llm/Cargo.toml @@ -7,6 +7,13 @@ exclude = ["/js", "/node_modules"] links = "tauri-plugin-local-llm" description = "" +[features] +default = [] +metal = ["hypr-llama/metal"] +cuda = ["hypr-llama/cuda"] +vulkan = ["hypr-llama/vulkan"] +native = ["hypr-llama/native"] + [build-dependencies] tauri-plugin = { workspace = true, features = ["build"] } diff --git a/scripts/pre_build.py b/scripts/pre_build.py new file mode 100644 index 0000000000..74b39f4672 --- /dev/null +++ b/scripts/pre_build.py @@ -0,0 +1,187 @@ +# https://github.com/thewh1teagle/vibe/blob/9ffde8a/scripts/pre_build.js + +import os +import sys +import json +import subprocess +import urllib.request +import shutil +import platform +from pathlib import Path + +# BLAS +# https://github.com/utilityai/llama-cpp-rs/blob/2f433cd/llama-cpp-sys-2/build.rs#L279-L281 + +# OPENMP +# Can cause `the code execution cannot proceed because VCOMP140.DLL was not found` error on Windows + + +CONFIG = { + "openblas_realname": "openblas", + "vulkan_runtime_real_name": "vulkan_runtime", + "vulkan_sdk_real_name": "vulkan_sdk", + "windows": { + "openblas_name": "OpenBLAS-0.3.26-x64", + "openblas_url": "https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.26/OpenBLAS-0.3.26-x64.zip", + "vulkan_runtime_name": "VulkanRT-1.3.290.0-Components", + "vulkan_runtime_url": "https://sdk.lunarg.com/sdk/download/1.3.290.0/windows/VulkanRT-1.3.290.0-Components.zip", + "vulkan_sdk_name": "VulkanSDK-1.3.290.0-Installer", + "vulkan_sdk_url": "https://sdk.lunarg.com/sdk/download/1.3.290.0/windows/VulkanSDK-1.3.290.0-Installer.exe", + "vcpkg_packages": [], + }, +} + + +script_dir = Path(__file__).parent +tauri_dir = script_dir.parent / "apps" / "desktop" / "src-tauri" +os.chdir(tauri_dir) + + +cwd = Path.cwd() + + +def is_windows(): + return platform.system() == "Windows" + + +def is_linux(): + return platform.system() == "Linux" + + +def is_macos(): + return platform.system() == "Darwin" + + +def has_feature(name: str) -> bool: + return f"--{name}" in sys.argv or name in sys.argv + + +def run_command(cmd: str, quiet: bool = False) -> subprocess.CompletedProcess: + try: + result = subprocess.run( + cmd, shell=True, capture_output=quiet, text=True, check=False + ) + + if result.returncode != 0 and not quiet: + print(f"Command failed: {cmd}") + if result.stderr: + print(f"Error: {result.stderr}") + + return result + except Exception as e: + print(f"Error running command '{cmd}': {e}") + raise + + +def wget(url: str, file_path: str): + """Download a file using urllib""" + try: + print(f"Downloading: {file_path}") + urllib.request.urlretrieve(url, file_path) + print(f"Downloaded: {file_path}") + except Exception as e: + raise Exception(f"Failed to download {url}: {e}") + + +def setup_windows(): + openblas_path = cwd / CONFIG["openblas_realname"] + if not openblas_path.exists() and has_feature("openblas"): + openblas_archive = f"{CONFIG['windows']['openblas_name']}.zip" + wget(CONFIG["windows"]["openblas_url"], openblas_archive) + run_command( + f'"C:\\Program Files\\7-Zip\\7z.exe" x {openblas_archive} -o{CONFIG["openblas_realname"]}' + ) + os.remove(openblas_archive) + + # Copy include to lib + include_src = openblas_path / "include" + lib_dst = openblas_path / "lib" + if include_src.exists(): + shutil.copytree(str(include_src), str(lib_dst), dirs_exist_ok=True) + + # Copy libopenblas.lib to openblas.lib + libopenblas = lib_dst / "libopenblas.lib" + openblas_lib = lib_dst / "openblas.lib" + if libopenblas.exists(): + shutil.copy2(str(libopenblas), str(openblas_lib)) + + # Setup Vulkan + vulkan_sdk_path = cwd / CONFIG["vulkan_sdk_real_name"] + if not vulkan_sdk_path.exists() and has_feature("vulkan"): + # Download and install Vulkan SDK + vulkan_sdk_exe = f"{CONFIG['windows']['vulkan_sdk_name']}.exe" + wget(CONFIG["windows"]["vulkan_sdk_url"], vulkan_sdk_exe) + + executable = cwd / vulkan_sdk_exe + vulkan_sdk_root = cwd / CONFIG["vulkan_sdk_real_name"] + run_command( + f'{executable} --root "{vulkan_sdk_root}" --accept-licenses --default-answer --confirm-command install copy_only=1' + ) + + # Download and extract Vulkan Runtime + vulkan_runtime_archive = f"{CONFIG['windows']['vulkan_runtime_name']}.zip" + wget(CONFIG["windows"]["vulkan_runtime_url"], vulkan_runtime_archive) + run_command(f'"C:\\Program Files\\7-Zip\\7z.exe" x {vulkan_runtime_archive}') + shutil.move( + CONFIG["windows"]["vulkan_runtime_name"], CONFIG["vulkan_runtime_real_name"] + ) + + # Cleanup + os.remove(vulkan_sdk_exe) + os.remove(vulkan_runtime_archive) + + # Setup vcpkg packages + if CONFIG["windows"]["vcpkg_packages"]: + packages = " ".join(CONFIG["windows"]["vcpkg_packages"]) + run_command(f"C:\\vcpkg\\vcpkg.exe install {packages}", quiet=True) + + +def setup_openblas(): + if not has_feature("openblas"): + return + + if is_windows(): + config_file = cwd / "tauri.windows.conf.json" + if config_file.exists(): + with open(config_file, "r") as f: + tauri_config = json.load(f) + + resources = tauri_config.setdefault("bundle", {}).setdefault( + "resources", {} + ) + resources["openblas\\bin\\*.dll"] = "./" + + with open(config_file, "w") as f: + json.dump(tauri_config, f, indent=4) + + +def setup_vulkan(): + if not has_feature("vulkan"): + return + + vulkan_path = cwd / CONFIG["vulkan_sdk_real_name"] + vulkan_runtime_path = cwd / CONFIG["vulkan_runtime_real_name"] + + if is_windows(): + config_file = cwd / "tauri.windows.conf.json" + if config_file.exists(): + with open(config_file, "r") as f: + tauri_config = json.load(f) + + resources = tauri_config.setdefault("bundle", {}).setdefault( + "resources", {} + ) + resources["vulkan_runtime\\x64\\*.dll"] = "./" + + with open(config_file, "w") as f: + json.dump(tauri_config, f, indent=4) + + +def main(): + if is_windows(): + setup_windows() + setup_vulkan() + + +if __name__ == "__main__": + main() From 3b2227b4df1ed785fbdcfcb29ca083777bd2a923 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Sun, 22 Jun 2025 19:11:58 +0900 Subject: [PATCH 2/8] split whisper crate --- Cargo.lock | 36 ++++++++++++++++-- Cargo.toml | 4 ++ crates/stt/Cargo.toml | 6 +-- crates/stt/src/realtime/mod.rs | 4 +- crates/stt/src/realtime/whisper.rs | 2 +- crates/whisper-cloud/Cargo.toml | 29 ++++++++++++++ .../src/cloud => whisper-cloud/src}/client.rs | 5 ++- .../cloud/mod.rs => whisper-cloud/src/lib.rs} | 0 .../src/cloud => whisper-cloud/src}/types.rs | 0 crates/whisper-local/Cargo.toml | 33 ++++++++++++++++ .../src/local => whisper-local/src}/error.rs | 0 .../local/mod.rs => whisper-local/src/lib.rs} | 0 .../src/local => whisper-local/src}/model.rs | 10 +++-- .../src/local => whisper-local/src}/stream.rs | 2 +- crates/whisper/Cargo.toml | 38 ------------------- crates/whisper/src/lib.rs | 6 --- plugins/local-stt/Cargo.toml | 3 +- plugins/local-stt/src/ext.rs | 2 +- plugins/local-stt/src/server.rs | 6 +-- 19 files changed, 120 insertions(+), 66 deletions(-) create mode 100644 crates/whisper-cloud/Cargo.toml rename crates/{whisper/src/cloud => whisper-cloud/src}/client.rs (95%) rename crates/{whisper/src/cloud/mod.rs => whisper-cloud/src/lib.rs} (100%) rename crates/{whisper/src/cloud => whisper-cloud/src}/types.rs (100%) create mode 100644 crates/whisper-local/Cargo.toml rename crates/{whisper/src/local => whisper-local/src}/error.rs (100%) rename crates/{whisper/src/local/mod.rs => whisper-local/src/lib.rs} (100%) rename crates/{whisper/src/local => whisper-local/src}/model.rs (97%) rename crates/{whisper/src/local => whisper-local/src}/stream.rs (98%) diff --git a/Cargo.lock b/Cargo.lock index e799a2cd0b..d276d94b3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12965,7 +12965,7 @@ dependencies = [ "specta", "thiserror 2.0.12", "tokio", - "whisper", + "whisper-cloud", ] [[package]] @@ -13803,6 +13803,7 @@ dependencies = [ "tower-http 0.6.4", "tracing", "whisper", + "whisper-local", "ws-utils", ] @@ -16133,6 +16134,13 @@ dependencies = [ [[package]] name = "whisper" version = "0.1.0" +dependencies = [ + "strum 0.26.3", +] + +[[package]] +name = "whisper-cloud" +version = "0.1.0" dependencies = [ "audio-utils", "bytes", @@ -16141,9 +16149,7 @@ dependencies = [ "dirs 6.0.0", "futures-util", "kalosm-sound", - "lazy_static", "llama", - "regex", "rodio", "serde", "serde_json", @@ -16152,10 +16158,32 @@ dependencies = [ "tokio", "tracing", "url", - "whisper-rs", + "whisper", "ws", ] +[[package]] +name = "whisper-local" +version = "0.1.0" +dependencies = [ + "audio-utils", + "dasp", + "data", + "dirs 6.0.0", + "futures-util", + "kalosm-sound", + "lazy_static", + "llama", + "regex", + "rodio", + "serde", + "serde_json", + "thiserror 2.0.12", + "tracing", + "whisper", + "whisper-rs", +] + [[package]] name = "whisper-rs" version = "0.14.2" diff --git a/Cargo.toml b/Cargo.toml index 75a8f55461..d153b433fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,6 +30,7 @@ hypr-calendar-google = { path = "crates/calendar-google", package = "calendar-go hypr-calendar-interface = { path = "crates/calendar-interface", package = "calendar-interface" } hypr-calendar-outlook = { path = "crates/calendar-outlook", package = "calendar-outlook" } hypr-chunker = { path = "crates/chunker", package = "chunker" } +hypr-clova = { path = "crates/clova", package = "clova" } hypr-data = { path = "crates/data", package = "data" } hypr-db-admin = { path = "crates/db-admin", package = "db-admin" } hypr-db-core = { path = "crates/db-core", package = "db-core" } @@ -51,6 +52,7 @@ hypr-notion = { path = "crates/notion", package = "notion" } hypr-onnx = { path = "crates/onnx", package = "onnx" } hypr-openai = { path = "crates/openai", package = "openai" } hypr-pyannote = { path = "crates/pyannote", package = "pyannote" } +hypr-rtzr = { path = "crates/rtzr", package = "rtzr" } hypr-s3 = { path = "crates/s3", package = "s3" } hypr-slack = { path = "crates/slack", package = "slack" } hypr-stt = { path = "crates/stt", package = "stt", features = ["realtime", "recorded"] } @@ -58,6 +60,8 @@ hypr-template = { path = "crates/template", package = "template" } hypr-turso = { path = "crates/turso", package = "turso" } hypr-vad = { path = "crates/vad", package = "vad" } hypr-whisper = { path = "crates/whisper", package = "whisper" } +hypr-whisper-cloud = { path = "crates/whisper-cloud", package = "whisper-cloud" } +hypr-whisper-local = { path = "crates/whisper-local", package = "whisper-local" } hypr-ws = { path = "crates/ws", package = "ws" } hypr-ws-utils = { path = "crates/ws-utils", package = "ws-utils" } diff --git a/crates/stt/Cargo.toml b/crates/stt/Cargo.toml index c5f1397898..974848ef66 100644 --- a/crates/stt/Cargo.toml +++ b/crates/stt/Cargo.toml @@ -11,12 +11,12 @@ local = [] [dependencies] hypr-audio-utils = { workspace = true } -hypr-clova = { path = "../clova", package = "clova" } +hypr-clova = { workspace = true } hypr-db-user = { workspace = true } hypr-language = { workspace = true, features = ["deepgram", "whisper"] } hypr-listener-interface = { workspace = true } -hypr-rtzr = { path = "../rtzr", package = "rtzr" } -hypr-whisper = { workspace = true, features = ["cloud"] } +hypr-rtzr = { workspace = true } +hypr-whisper-cloud = { workspace = true } deepgram = { workspace = true, default-features = false, features = ["listen"] } diff --git a/crates/stt/src/realtime/mod.rs b/crates/stt/src/realtime/mod.rs index 265011783f..eb5c0ae694 100644 --- a/crates/stt/src/realtime/mod.rs +++ b/crates/stt/src/realtime/mod.rs @@ -54,7 +54,7 @@ impl ClientBuilder { pub enum MultiClient { Clova(hypr_clova::realtime::Client), Deepgram(DeepgramClient), - Whisper(hypr_whisper::cloud::WhisperClient), + Whisper(hypr_whisper_cloud::WhisperClient), } #[derive(Debug, Clone)] @@ -80,7 +80,7 @@ impl Client { MultiClient::Clova(clova) } hypr_language::ISO639::De => { - let whisper = hypr_whisper::cloud::WhisperClient::builder() + let whisper = hypr_whisper_cloud::WhisperClient::builder() .api_base(std::env::var("WHISPER_API_BASE").unwrap()) .api_key(std::env::var("WHISPER_API_KEY").unwrap()) .language(language.try_into().unwrap()) diff --git a/crates/stt/src/realtime/whisper.rs b/crates/stt/src/realtime/whisper.rs index bd88a14786..81ab81e365 100644 --- a/crates/stt/src/realtime/whisper.rs +++ b/crates/stt/src/realtime/whisper.rs @@ -2,7 +2,7 @@ use bytes::Bytes; use futures_util::{Stream, StreamExt}; use std::error::Error; -use hypr_whisper::cloud::WhisperClient; +use hypr_whisper_cloud::WhisperClient; use super::RealtimeSpeechToText; use hypr_listener_interface::{ListenOutputChunk, Word}; diff --git a/crates/whisper-cloud/Cargo.toml b/crates/whisper-cloud/Cargo.toml new file mode 100644 index 0000000000..0a73a1d404 --- /dev/null +++ b/crates/whisper-cloud/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "whisper-cloud" +version = "0.1.0" +edition = "2021" + +[dev-dependencies] +hypr-data = { workspace = true } +hypr-llama = { workspace = true } + +dirs = { workspace = true } +futures-util = { workspace = true } +tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } + +[dependencies] +hypr-audio-utils = { workspace = true } +hypr-whisper = { workspace = true } +hypr-ws = { workspace = true } + +bytes = { workspace = true } +cpal = { workspace = true } +futures-util = { workspace = true } +kalosm-sound = { workspace = true, default-features = false } +rodio = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +strum = { workspace = true, features = ["derive"] } +thiserror = { workspace = true } +tracing = { workspace = true } +url = { workspace = true } diff --git a/crates/whisper/src/cloud/client.rs b/crates/whisper-cloud/src/client.rs similarity index 95% rename from crates/whisper/src/cloud/client.rs rename to crates/whisper-cloud/src/client.rs index 5af582bf0f..7e4105edb4 100644 --- a/crates/whisper/src/cloud/client.rs +++ b/crates/whisper-cloud/src/client.rs @@ -2,6 +2,7 @@ use futures_util::Stream; use kalosm_sound::AsyncSource; use hypr_audio_utils::AudioFormatExt; +use hypr_whisper::Language; use hypr_ws::client::{ClientRequestBuilder, Message, WebSocketClient, WebSocketIO}; use super::WhisperOutput; @@ -10,7 +11,7 @@ use super::WhisperOutput; pub struct WhisperClientBuilder { api_base: Option, api_key: Option, - language: Option, + language: Option, } #[derive(Debug, Clone)] @@ -29,7 +30,7 @@ impl WhisperClientBuilder { self } - pub fn language(mut self, language: crate::Language) -> Self { + pub fn language(mut self, language: Language) -> Self { self.language = Some(language); self } diff --git a/crates/whisper/src/cloud/mod.rs b/crates/whisper-cloud/src/lib.rs similarity index 100% rename from crates/whisper/src/cloud/mod.rs rename to crates/whisper-cloud/src/lib.rs diff --git a/crates/whisper/src/cloud/types.rs b/crates/whisper-cloud/src/types.rs similarity index 100% rename from crates/whisper/src/cloud/types.rs rename to crates/whisper-cloud/src/types.rs diff --git a/crates/whisper-local/Cargo.toml b/crates/whisper-local/Cargo.toml new file mode 100644 index 0000000000..908850d108 --- /dev/null +++ b/crates/whisper-local/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "whisper-local" +version = "0.1.0" +edition = "2021" + +[features] +default = [] + +[dev-dependencies] +hypr-data = { workspace = true } +hypr-llama = { workspace = true } + +dirs = { workspace = true } +futures-util = { workspace = true } + +[dependencies] +hypr-audio-utils = { workspace = true } +hypr-whisper = { workspace = true } + +dasp = { workspace = true } +kalosm-sound = { workspace = true, default-features = false } +rodio = { workspace = true } +whisper-rs = { git = "https://github.com/tazz4843/whisper-rs", rev = "de30f9c", features = ["raw-api", "tracing_backend"] } + +futures-util = { workspace = true } +tracing = { workspace = true } + +serde = { workspace = true } +serde_json = { workspace = true } +thiserror = { workspace = true } + +lazy_static = { workspace = true } +regex = { workspace = true } diff --git a/crates/whisper/src/local/error.rs b/crates/whisper-local/src/error.rs similarity index 100% rename from crates/whisper/src/local/error.rs rename to crates/whisper-local/src/error.rs diff --git a/crates/whisper/src/local/mod.rs b/crates/whisper-local/src/lib.rs similarity index 100% rename from crates/whisper/src/local/mod.rs rename to crates/whisper-local/src/lib.rs diff --git a/crates/whisper/src/local/model.rs b/crates/whisper-local/src/model.rs similarity index 97% rename from crates/whisper/src/local/model.rs rename to crates/whisper-local/src/model.rs index 5aa7c17f31..d949eb7dc9 100644 --- a/crates/whisper/src/local/model.rs +++ b/crates/whisper-local/src/model.rs @@ -8,6 +8,8 @@ use whisper_rs::{ WhisperToken, }; +use hypr_whisper::Language; + lazy_static! { static ref TRAILING_DOTS: Regex = Regex::new(r"\.{2,}$").unwrap(); } @@ -15,7 +17,7 @@ lazy_static! { #[derive(Default)] pub struct WhisperBuilder { model_path: Option, - language: Option, + language: Option, static_prompt: Option, dynamic_prompt: Option, } @@ -26,7 +28,7 @@ impl WhisperBuilder { self } - pub fn language(mut self, language: crate::Language) -> Self { + pub fn language(mut self, language: Language) -> Self { self.language = Some(language); self } @@ -60,7 +62,7 @@ impl WhisperBuilder { let token_eot = ctx.token_eot(); let token_beg = ctx.token_beg(); - let language = self.language.unwrap_or(crate::Language::En); + let language = self.language.unwrap_or(Language::En); Whisper { language, @@ -84,7 +86,7 @@ impl WhisperBuilder { } pub struct Whisper { - language: crate::Language, + language: Language, static_prompt: String, dynamic_prompt: String, state: WhisperState, diff --git a/crates/whisper/src/local/stream.rs b/crates/whisper-local/src/stream.rs similarity index 98% rename from crates/whisper/src/local/stream.rs rename to crates/whisper-local/src/stream.rs index 65ecb00239..3b11094607 100644 --- a/crates/whisper/src/local/stream.rs +++ b/crates/whisper-local/src/stream.rs @@ -3,7 +3,7 @@ use std::{ task::{Context, Poll}, }; -use cpal::FromSample; +use dasp::sample::FromSample; use futures_util::{Stream, StreamExt}; use rodio::Source; diff --git a/crates/whisper/Cargo.toml b/crates/whisper/Cargo.toml index a0f509c3ae..cf944162b4 100644 --- a/crates/whisper/Cargo.toml +++ b/crates/whisper/Cargo.toml @@ -3,43 +3,5 @@ name = "whisper" version = "0.1.0" edition = "2021" -[features] -default = [] -local = ["whisper-rs", "lazy_static", "regex"] -cloud = [] - -[dev-dependencies] -hypr-data = { workspace = true } -hypr-llama = { workspace = true } - -dirs = { workspace = true } -futures-util = { workspace = true } -tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } - [dependencies] -hypr-audio-utils = { workspace = true } -hypr-ws = { workspace = true } - -bytes = { workspace = true } -cpal = { workspace = true } -futures-util = { workspace = true } -kalosm-sound = { workspace = true, default-features = false } -rodio = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } strum = { workspace = true, features = ["derive"] } -thiserror = { workspace = true } -tracing = { workspace = true } -url = { workspace = true } - -lazy_static = { workspace = true, optional = true } -regex = { workspace = true, optional = true } - -[target.'cfg(not(target_os = "macos"))'.dependencies] -whisper-rs = { git = "https://github.com/tazz4843/whisper-rs", rev = "de30f9c", features = ["raw-api", "tracing_backend"], optional = true } - -[target.'cfg(all(target_os = "macos", target_arch = "aarch64"))'.dependencies] -whisper-rs = { git = "https://github.com/tazz4843/whisper-rs", rev = "de30f9c", 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 = "de30f9c", features = ["raw-api", "tracing_backend"], optional = true } diff --git a/crates/whisper/src/lib.rs b/crates/whisper/src/lib.rs index 4779baffc1..7e144329ac 100644 --- a/crates/whisper/src/lib.rs +++ b/crates/whisper/src/lib.rs @@ -1,9 +1,3 @@ -#[cfg(feature = "local")] -pub mod local; - -#[cfg(feature = "cloud")] -pub mod cloud; - // https://github.com/openai/whisper/blob/ba3f3cd/whisper/tokenizer.py#L10-L128 #[derive(strum::EnumString, strum::Display, strum::AsRefStr)] pub enum Language { diff --git a/plugins/local-stt/Cargo.toml b/plugins/local-stt/Cargo.toml index 0cea955de7..13f9f59d13 100644 --- a/plugins/local-stt/Cargo.toml +++ b/plugins/local-stt/Cargo.toml @@ -30,7 +30,8 @@ hypr-db-user = { workspace = true } hypr-file = { workspace = true } hypr-listener-interface = { workspace = true } hypr-pyannote = { workspace = true, features = ["local"] } -hypr-whisper = { workspace = true, features = ["local"] } +hypr-whisper = { workspace = true } +hypr-whisper-local = { workspace = true } hypr-ws-utils = { workspace = true } tauri = { workspace = true, features = ["test"] } diff --git a/plugins/local-stt/src/ext.rs b/plugins/local-stt/src/ext.rs index c714b44d76..036374d3a3 100644 --- a/plugins/local-stt/src/ext.rs +++ b/plugins/local-stt/src/ext.rs @@ -179,7 +179,7 @@ impl> LocalSttPluginExt for T { let samples_i16 = hypr_audio_utils::f32_to_i16_samples(&samples_f32); - let mut model = hypr_whisper::local::Whisper::builder() + let mut model = hypr_whisper_local::Whisper::builder() .model_path(model_path.as_ref().to_str().unwrap()) .language(hypr_whisper::Language::En) .static_prompt("") diff --git a/plugins/local-stt/src/server.rs b/plugins/local-stt/src/server.rs index e4034d5cca..bf54a90d0f 100644 --- a/plugins/local-stt/src/server.rs +++ b/plugins/local-stt/src/server.rs @@ -130,7 +130,7 @@ async fn websocket_with_model( hypr_whisper::Language::En }); - let model = hypr_whisper::local::Whisper::builder() + let model = hypr_whisper_local::Whisper::builder() .model_path(model_path.to_str().unwrap()) .language(language) .static_prompt(¶ms.static_prompt) @@ -141,13 +141,13 @@ async fn websocket_with_model( } #[tracing::instrument(skip_all)] -async fn websocket(socket: WebSocket, model: hypr_whisper::local::Whisper, guard: ConnectionGuard) { +async fn websocket(socket: WebSocket, model: hypr_whisper_local::Whisper, guard: ConnectionGuard) { let (mut ws_sender, ws_receiver) = socket.split(); let mut stream = { let audio_source = WebSocketAudioSource::new(ws_receiver, 16 * 1000); let chunked = audio_source.chunks(hypr_chunker::RMS::new(), std::time::Duration::from_secs(15)); - hypr_whisper::local::TranscribeChunkedAudioStreamExt::transcribe(chunked, model) + hypr_whisper_local::TranscribeChunkedAudioStreamExt::transcribe(chunked, model) }; loop { From 91052ea78b780771e1b1ceda95f5be3135b837a5 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Sun, 22 Jun 2025 19:26:55 +0900 Subject: [PATCH 3/8] hoist feature to desktop --- Cargo.lock | 8 ++++---- apps/desktop/src-tauri/Cargo.toml | 19 +++++++++++++++++++ crates/llama/Cargo.toml | 1 + crates/whisper-local/Cargo.toml | 10 +++++++++- plugins/local-stt/Cargo.toml | 10 ++++++++++ 5 files changed, 43 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d276d94b3f..5da330d5ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16186,8 +16186,8 @@ dependencies = [ [[package]] name = "whisper-rs" -version = "0.14.2" -source = "git+https://github.com/tazz4843/whisper-rs?rev=de30f9c#de30f9c23da52c81b06fa78bab005ab353d74637" +version = "0.14.3" +source = "git+https://github.com/tazz4843/whisper-rs?rev=e3d67d5#e3d67d513b86c6360f62e1f563bc4601c87946d6" dependencies = [ "tracing", "whisper-rs-sys", @@ -16195,8 +16195,8 @@ dependencies = [ [[package]] name = "whisper-rs-sys" -version = "0.12.1" -source = "git+https://github.com/tazz4843/whisper-rs?rev=de30f9c#de30f9c23da52c81b06fa78bab005ab353d74637" +version = "0.13.0" +source = "git+https://github.com/tazz4843/whisper-rs?rev=e3d67d5#e3d67d513b86c6360f62e1f563bc4601c87946d6" dependencies = [ "bindgen 0.71.1", "cfg-if", diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index 0d717b1aad..aef1875125 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -93,3 +93,22 @@ tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } tokio-stream = { workspace = true } hound = { workspace = true } + +[features] +default = [] +llm-metal = ["tauri-plugin-local-llm/metal"] +llm-cuda = ["tauri-plugin-local-llm/cuda"] +llm-vulkan = ["tauri-plugin-local-llm/vulkan"] +llm-native = ["tauri-plugin-local-llm/native"] + +stt-coreml = ["tauri-plugin-local-stt/coreml"] +stt-cuda = ["tauri-plugin-local-stt/cuda"] +stt-hipblas = ["tauri-plugin-local-stt/hipblas"] +stt-openblas = ["tauri-plugin-local-stt/openblas"] +stt-metal = ["tauri-plugin-local-stt/metal"] +stt-vulkan = ["tauri-plugin-local-stt/vulkan"] +stt-openmp = ["tauri-plugin-local-stt/openmp"] + +metal = ["llm-metal", "stt-metal"] +cuda = ["llm-cuda", "stt-cuda"] +vulkan = ["llm-vulkan", "stt-vulkan"] diff --git a/crates/llama/Cargo.toml b/crates/llama/Cargo.toml index a905a14e18..ffae8b46d6 100644 --- a/crates/llama/Cargo.toml +++ b/crates/llama/Cargo.toml @@ -10,6 +10,7 @@ metal = ["llama-cpp-2/metal"] cuda = ["llama-cpp-2/cuda"] vulkan = ["llama-cpp-2/vulkan"] native = ["llama-cpp-2/native"] +openmp = ["llama-cpp-2/openmp"] [dependencies] hypr-gguf = { workspace = true } diff --git a/crates/whisper-local/Cargo.toml b/crates/whisper-local/Cargo.toml index 908850d108..df0727a637 100644 --- a/crates/whisper-local/Cargo.toml +++ b/crates/whisper-local/Cargo.toml @@ -3,8 +3,16 @@ name = "whisper-local" version = "0.1.0" edition = "2021" +# https://github.com/tazz4843/whisper-rs/blob/e3d67d5/Cargo.toml [features] default = [] +coreml = ["whisper-rs/coreml"] +cuda = ["whisper-rs/cuda"] +hipblas = ["whisper-rs/hipblas"] +openblas = ["whisper-rs/openblas"] +metal = ["whisper-rs/metal"] +vulkan = ["whisper-rs/vulkan"] +openmp = ["whisper-rs/openmp"] [dev-dependencies] hypr-data = { workspace = true } @@ -20,7 +28,7 @@ hypr-whisper = { workspace = true } dasp = { workspace = true } kalosm-sound = { workspace = true, default-features = false } rodio = { workspace = true } -whisper-rs = { git = "https://github.com/tazz4843/whisper-rs", rev = "de30f9c", features = ["raw-api", "tracing_backend"] } +whisper-rs = { git = "https://github.com/tazz4843/whisper-rs", rev = "e3d67d5", features = ["raw-api", "tracing_backend"] } futures-util = { workspace = true } tracing = { workspace = true } diff --git a/plugins/local-stt/Cargo.toml b/plugins/local-stt/Cargo.toml index 13f9f59d13..11cc7dd943 100644 --- a/plugins/local-stt/Cargo.toml +++ b/plugins/local-stt/Cargo.toml @@ -7,6 +7,16 @@ exclude = ["/js", "/node_modules"] links = "tauri-plugin-local-stt" description = "" +[features] +default = [] +coreml = ["hypr-whisper-local/coreml"] +cuda = ["hypr-whisper-local/cuda"] +hipblas = ["hypr-whisper-local/hipblas"] +openblas = ["hypr-whisper-local/openblas"] +metal = ["hypr-whisper-local/metal"] +vulkan = ["hypr-whisper-local/vulkan"] +openmp = ["hypr-whisper-local/openmp"] + [build-dependencies] tauri-plugin = { workspace = true, features = ["build"] } From 8fd725db2c3f7ef6a465509355b2bb803d95c4be Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Sun, 22 Jun 2025 19:49:11 +0900 Subject: [PATCH 4/8] wip --- Cargo.lock | 1 + apps/desktop/src-tauri/Cargo.toml | 4 +++- apps/desktop/src-tauri/build.rs | 12 ++++++++++++ crates/llama/src/lib.rs | 3 ++- crates/whisper-local/Cargo.toml | 1 + crates/whisper-local/src/model.rs | 6 ++++-- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5da330d5ac..961a3c8ee0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16179,6 +16179,7 @@ dependencies = [ "serde", "serde_json", "thiserror 2.0.12", + "tokio", "tracing", "whisper", "whisper-rs", diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index aef1875125..a58da4f9cb 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -95,7 +95,9 @@ tokio-stream = { workspace = true } hound = { workspace = true } [features] -default = [] +macos-default = ["llm-metal", "stt-metal", "stt-coreml"] +windows-default = ["llm-vulkan", "llm-native", "stt-vulkan", "stt-openblas"] + llm-metal = ["tauri-plugin-local-llm/metal"] llm-cuda = ["tauri-plugin-local-llm/cuda"] llm-vulkan = ["tauri-plugin-local-llm/vulkan"] diff --git a/apps/desktop/src-tauri/build.rs b/apps/desktop/src-tauri/build.rs index d860e1e6a7..b4d27bfc2e 100644 --- a/apps/desktop/src-tauri/build.rs +++ b/apps/desktop/src-tauri/build.rs @@ -1,3 +1,15 @@ fn main() { + let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); + + match target_os.as_str() { + "macos" => { + println!("cargo:rustc-cfg=feature=\"macos-default\""); + } + "windows" => { + println!("cargo:rustc-cfg=feature=\"windows-default\""); + } + _ => {} + } + tauri_build::build() } diff --git a/crates/llama/src/lib.rs b/crates/llama/src/lib.rs index 923751e97b..f03d13ca7a 100644 --- a/crates/llama/src/lib.rs +++ b/crates/llama/src/lib.rs @@ -77,7 +77,8 @@ impl Llama { } pub fn new(model_path: impl AsRef) -> Result { - send_logs_to_tracing(LogOptions::default().with_logs_enabled(false)); + let show_logs = if cfg!(debug_assertions) { true } else { false }; + send_logs_to_tracing(LogOptions::default().with_logs_enabled(show_logs)); let fmt = model_path.gguf_chat_format()?.unwrap(); let tpl = LlamaChatTemplate::new(fmt.as_ref()).unwrap(); diff --git a/crates/whisper-local/Cargo.toml b/crates/whisper-local/Cargo.toml index df0727a637..4c6625243d 100644 --- a/crates/whisper-local/Cargo.toml +++ b/crates/whisper-local/Cargo.toml @@ -20,6 +20,7 @@ hypr-llama = { workspace = true } dirs = { workspace = true } futures-util = { workspace = true } +tokio = { workspace = true } [dependencies] hypr-audio-utils = { workspace = true } diff --git a/crates/whisper-local/src/model.rs b/crates/whisper-local/src/model.rs index d949eb7dc9..f1f089e3cf 100644 --- a/crates/whisper-local/src/model.rs +++ b/crates/whisper-local/src/model.rs @@ -44,13 +44,15 @@ impl WhisperBuilder { } pub fn build(self) -> Whisper { - unsafe { Self::suppress_log() }; + if cfg!(debug_assertions) { + unsafe { Self::suppress_log() }; + } let context_param = { let mut p = WhisperContextParameters::default(); p.gpu_device = 0; p.use_gpu = true; - p.flash_attn = true; + p.flash_attn = false; // crash on macos p.dtw_parameters.mode = whisper_rs::DtwMode::None; p }; From f7782bbfe898ff25d096f4f2bccd741682542f18 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Sun, 22 Jun 2025 21:30:56 +0900 Subject: [PATCH 5/8] split pyannote and add directml --- Cargo.lock | 20 ++++++++++++++--- Cargo.toml | 3 ++- apps/desktop/src-tauri/Cargo.toml | 3 ++- crates/onnx/Cargo.toml | 7 +++++- crates/pyannote-cloud/Cargo.toml | 21 ++++++++++++++++++ .../cloud => pyannote-cloud/src}/get_job.rs | 0 .../mod.rs => pyannote-cloud/src/lib.rs} | 0 .../src}/submit_diarization_job.rs | 0 .../cloud => pyannote-cloud/src}/test_key.rs | 0 .../{pyannote => pyannote-local}/Cargo.toml | 16 ++++++------- .../src}/data/embedding.onnx | 0 .../src}/data/female_welcome_1.mp3 | Bin .../src}/data/male_welcome_1.mp3 | Bin .../src}/data/male_welcome_2.mp3 | Bin .../src}/data/segmentation.onnx | Bin .../local => pyannote-local/src}/embedding.rs | 7 +++--- .../mod.rs => pyannote-local/src/lib.rs} | 0 .../src}/segmentation.rs | 0 crates/pyannote/src/lib.rs | 5 ----- plugins/local-stt/Cargo.toml | 5 +++-- plugins/local-stt/src/ext.rs | 2 +- scripts/pre_build.py | 5 ++++- 22 files changed, 67 insertions(+), 27 deletions(-) create mode 100644 crates/pyannote-cloud/Cargo.toml rename crates/{pyannote/src/cloud => pyannote-cloud/src}/get_job.rs (100%) rename crates/{pyannote/src/cloud/mod.rs => pyannote-cloud/src/lib.rs} (100%) rename crates/{pyannote/src/cloud => pyannote-cloud/src}/submit_diarization_job.rs (100%) rename crates/{pyannote/src/cloud => pyannote-cloud/src}/test_key.rs (100%) rename crates/{pyannote => pyannote-local}/Cargo.toml (55%) rename crates/{pyannote/src/local => pyannote-local/src}/data/embedding.onnx (100%) rename crates/{pyannote/src/local => pyannote-local/src}/data/female_welcome_1.mp3 (100%) rename crates/{pyannote/src/local => pyannote-local/src}/data/male_welcome_1.mp3 (100%) rename crates/{pyannote/src/local => pyannote-local/src}/data/male_welcome_2.mp3 (100%) rename crates/{pyannote/src/local => pyannote-local/src}/data/segmentation.onnx (100%) rename crates/{pyannote/src/local => pyannote-local/src}/embedding.rs (95%) rename crates/{pyannote/src/local/mod.rs => pyannote-local/src/lib.rs} (100%) rename crates/{pyannote/src/local => pyannote-local/src}/segmentation.rs (100%) delete mode 100644 crates/pyannote/src/lib.rs mode change 100644 => 100755 scripts/pre_build.py diff --git a/Cargo.lock b/Cargo.lock index 961a3c8ee0..699a1b3b05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10366,7 +10366,22 @@ dependencies = [ ] [[package]] -name = "pyannote" +name = "pyannote-cloud" +version = "0.1.0" +dependencies = [ + "anyhow", + "data", + "reqwest 0.12.15", + "rodio", + "serde", + "specta", + "thiserror 2.0.12", + "tokio", + "url", +] + +[[package]] +name = "pyannote-local" version = "0.1.0" dependencies = [ "anyhow", @@ -10382,7 +10397,6 @@ dependencies = [ "specta", "thiserror 2.0.12", "tokio", - "url", ] [[package]] @@ -13782,7 +13796,7 @@ dependencies = [ "kalosm-sound", "language", "listener-interface", - "pyannote", + "pyannote-local", "reqwest 0.12.15", "rodio", "serde", diff --git a/Cargo.toml b/Cargo.toml index d153b433fc..159511864c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,8 @@ hypr-notification2 = { path = "crates/notification2", package = "notification2" hypr-notion = { path = "crates/notion", package = "notion" } hypr-onnx = { path = "crates/onnx", package = "onnx" } hypr-openai = { path = "crates/openai", package = "openai" } -hypr-pyannote = { path = "crates/pyannote", package = "pyannote" } +hypr-pyannote-cloud = { path = "crates/pyannote-cloud", package = "pyannote-cloud" } +hypr-pyannote-local = { path = "crates/pyannote-local", package = "pyannote-local" } hypr-rtzr = { path = "crates/rtzr", package = "rtzr" } hypr-s3 = { path = "crates/s3", package = "s3" } hypr-slack = { path = "crates/slack", package = "slack" } diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index a58da4f9cb..0692ce855b 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -96,7 +96,7 @@ hound = { workspace = true } [features] macos-default = ["llm-metal", "stt-metal", "stt-coreml"] -windows-default = ["llm-vulkan", "llm-native", "stt-vulkan", "stt-openblas"] +windows-default = ["llm-vulkan", "llm-native", "stt-vulkan", "stt-openblas", "stt-directml"] llm-metal = ["tauri-plugin-local-llm/metal"] llm-cuda = ["tauri-plugin-local-llm/cuda"] @@ -104,6 +104,7 @@ llm-vulkan = ["tauri-plugin-local-llm/vulkan"] llm-native = ["tauri-plugin-local-llm/native"] stt-coreml = ["tauri-plugin-local-stt/coreml"] +stt-directml = ["tauri-plugin-local-stt/directml"] stt-cuda = ["tauri-plugin-local-stt/cuda"] stt-hipblas = ["tauri-plugin-local-stt/hipblas"] stt-openblas = ["tauri-plugin-local-stt/openblas"] diff --git a/crates/onnx/Cargo.toml b/crates/onnx/Cargo.toml index 67569689e8..93ab45a3ef 100644 --- a/crates/onnx/Cargo.toml +++ b/crates/onnx/Cargo.toml @@ -3,6 +3,11 @@ name = "onnx" version = "0.1.0" edition = "2021" +[features] +default = [] +coreml = ["ort/coreml"] +directml = ["ort/directml"] + [dependencies] ndarray = "0.16" -ort = "=2.0.0-rc.9" +ort = { version = "=2.0.0-rc.9" } diff --git a/crates/pyannote-cloud/Cargo.toml b/crates/pyannote-cloud/Cargo.toml new file mode 100644 index 0000000000..52746e8ee3 --- /dev/null +++ b/crates/pyannote-cloud/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "pyannote-cloud" +version = "0.1.0" +edition = "2021" + +[dependencies] +reqwest = { workspace = true, features = ["json"] } +url = { workspace = true } + +anyhow = { workspace = true } +thiserror = { workspace = true } + +serde = { workspace = true, features = ["derive"] } +specta = { workspace = true, features = ["derive"] } + +[dev-dependencies] +hypr-data = { workspace = true } + +reqwest = { workspace = true, features = ["json"] } +rodio = { workspace = true } +tokio = { workspace = true, features = ["rt", "macros"] } diff --git a/crates/pyannote/src/cloud/get_job.rs b/crates/pyannote-cloud/src/get_job.rs similarity index 100% rename from crates/pyannote/src/cloud/get_job.rs rename to crates/pyannote-cloud/src/get_job.rs diff --git a/crates/pyannote/src/cloud/mod.rs b/crates/pyannote-cloud/src/lib.rs similarity index 100% rename from crates/pyannote/src/cloud/mod.rs rename to crates/pyannote-cloud/src/lib.rs diff --git a/crates/pyannote/src/cloud/submit_diarization_job.rs b/crates/pyannote-cloud/src/submit_diarization_job.rs similarity index 100% rename from crates/pyannote/src/cloud/submit_diarization_job.rs rename to crates/pyannote-cloud/src/submit_diarization_job.rs diff --git a/crates/pyannote/src/cloud/test_key.rs b/crates/pyannote-cloud/src/test_key.rs similarity index 100% rename from crates/pyannote/src/cloud/test_key.rs rename to crates/pyannote-cloud/src/test_key.rs diff --git a/crates/pyannote/Cargo.toml b/crates/pyannote-local/Cargo.toml similarity index 55% rename from crates/pyannote/Cargo.toml rename to crates/pyannote-local/Cargo.toml index 672e454a66..3f09da6489 100644 --- a/crates/pyannote/Cargo.toml +++ b/crates/pyannote-local/Cargo.toml @@ -1,21 +1,19 @@ [package] -name = "pyannote" +name = "pyannote-local" version = "0.1.0" edition = "2021" [features] default = [] -cloud = ["dep:reqwest", "dep:url"] -local = ["dep:hypr-onnx", "dep:knf-rs", "dep:simsimd", "dep:dasp"] +coreml = ["hypr-onnx/coreml"] +directml = ["hypr-onnx/directml"] [dependencies] -reqwest = { workspace = true, features = ["json"], optional = true } -url = { workspace = true, optional = true } +hypr-onnx = { workspace = true, features = ["coreml"] } -dasp = { workspace = true, optional = true } -hypr-onnx = { workspace = true, optional = true } -knf-rs = { git = "https://github.com/thewh1teagle/pyannote-rs", rev = "d97bd3b", package = "knf-rs", optional = true } -simsimd = { version = "6", optional = true } +dasp = { workspace = true } +knf-rs = { git = "https://github.com/thewh1teagle/pyannote-rs", rev = "d97bd3b", package = "knf-rs" } +simsimd = { version = "6" } anyhow = { workspace = true } thiserror = { workspace = true } diff --git a/crates/pyannote/src/local/data/embedding.onnx b/crates/pyannote-local/src/data/embedding.onnx similarity index 100% rename from crates/pyannote/src/local/data/embedding.onnx rename to crates/pyannote-local/src/data/embedding.onnx diff --git a/crates/pyannote/src/local/data/female_welcome_1.mp3 b/crates/pyannote-local/src/data/female_welcome_1.mp3 similarity index 100% rename from crates/pyannote/src/local/data/female_welcome_1.mp3 rename to crates/pyannote-local/src/data/female_welcome_1.mp3 diff --git a/crates/pyannote/src/local/data/male_welcome_1.mp3 b/crates/pyannote-local/src/data/male_welcome_1.mp3 similarity index 100% rename from crates/pyannote/src/local/data/male_welcome_1.mp3 rename to crates/pyannote-local/src/data/male_welcome_1.mp3 diff --git a/crates/pyannote/src/local/data/male_welcome_2.mp3 b/crates/pyannote-local/src/data/male_welcome_2.mp3 similarity index 100% rename from crates/pyannote/src/local/data/male_welcome_2.mp3 rename to crates/pyannote-local/src/data/male_welcome_2.mp3 diff --git a/crates/pyannote/src/local/data/segmentation.onnx b/crates/pyannote-local/src/data/segmentation.onnx similarity index 100% rename from crates/pyannote/src/local/data/segmentation.onnx rename to crates/pyannote-local/src/data/segmentation.onnx diff --git a/crates/pyannote/src/local/embedding.rs b/crates/pyannote-local/src/embedding.rs similarity index 95% rename from crates/pyannote/src/local/embedding.rs rename to crates/pyannote-local/src/embedding.rs index 44e743fe6f..667a707c60 100644 --- a/crates/pyannote/src/local/embedding.rs +++ b/crates/pyannote-local/src/embedding.rs @@ -1,5 +1,4 @@ -use dasp::sample::{FromSample, Sample, ToSample}; -use simsimd::SpatialSimilarity; +use dasp::sample::ToSample; use hypr_onnx::{ ndarray::{self, Array2}, @@ -40,7 +39,7 @@ impl EmbeddingExtractor { Ok(embeddings) } - pub fn cluster(&self, n_clusters: usize, embeddings: &[f32]) -> Vec { + pub fn cluster(&self, _n_clusters: usize, embeddings: &[f32]) -> Vec { let assignments = vec![0; embeddings.len()]; assignments } @@ -50,6 +49,8 @@ impl EmbeddingExtractor { mod tests { use super::*; + use dasp::sample::{FromSample, Sample}; + fn get_audio>(path: &str) -> Vec { let base = std::path::Path::new(env!("CARGO_MANIFEST_DIR")); let p = base.join("src/local/data").join(path); diff --git a/crates/pyannote/src/local/mod.rs b/crates/pyannote-local/src/lib.rs similarity index 100% rename from crates/pyannote/src/local/mod.rs rename to crates/pyannote-local/src/lib.rs diff --git a/crates/pyannote/src/local/segmentation.rs b/crates/pyannote-local/src/segmentation.rs similarity index 100% rename from crates/pyannote/src/local/segmentation.rs rename to crates/pyannote-local/src/segmentation.rs diff --git a/crates/pyannote/src/lib.rs b/crates/pyannote/src/lib.rs deleted file mode 100644 index bf06af06a7..0000000000 --- a/crates/pyannote/src/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -#[cfg(feature = "cloud")] -pub mod cloud; - -#[cfg(feature = "local")] -pub mod local; diff --git a/plugins/local-stt/Cargo.toml b/plugins/local-stt/Cargo.toml index 11cc7dd943..587001066d 100644 --- a/plugins/local-stt/Cargo.toml +++ b/plugins/local-stt/Cargo.toml @@ -9,7 +9,8 @@ description = "" [features] default = [] -coreml = ["hypr-whisper-local/coreml"] +coreml = ["hypr-whisper-local/coreml", "hypr-pyannote-local/coreml"] +directml = ["hypr-pyannote-local/directml"] cuda = ["hypr-whisper-local/cuda"] hipblas = ["hypr-whisper-local/hipblas"] openblas = ["hypr-whisper-local/openblas"] @@ -39,7 +40,7 @@ hypr-chunker = { workspace = true } hypr-db-user = { workspace = true } hypr-file = { workspace = true } hypr-listener-interface = { workspace = true } -hypr-pyannote = { workspace = true, features = ["local"] } +hypr-pyannote-local = { workspace = true } hypr-whisper = { workspace = true } hypr-whisper-local = { workspace = true } hypr-ws-utils = { workspace = true } diff --git a/plugins/local-stt/src/ext.rs b/plugins/local-stt/src/ext.rs index 036374d3a3..7e91b20e8e 100644 --- a/plugins/local-stt/src/ext.rs +++ b/plugins/local-stt/src/ext.rs @@ -186,7 +186,7 @@ impl> LocalSttPluginExt for T { .dynamic_prompt("") .build(); - let mut segmenter = hypr_pyannote::local::segmentation::Segmenter::new(16000).unwrap(); + let mut segmenter = hypr_pyannote_local::segmentation::Segmenter::new(16000).unwrap(); let segments = segmenter.process(&samples_i16, 16000).unwrap(); let mut words = Vec::new(); diff --git a/scripts/pre_build.py b/scripts/pre_build.py old mode 100644 new mode 100755 index 74b39f4672..ca1f55e888 --- a/scripts/pre_build.py +++ b/scripts/pre_build.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + # https://github.com/thewh1teagle/vibe/blob/9ffde8a/scripts/pre_build.js import os @@ -184,4 +186,5 @@ def main(): if __name__ == "__main__": - main() + # main() + print(tauri_dir) From cc36eeaa62b991b7da5d496e409f6d8126bb76d6 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Sun, 22 Jun 2025 21:56:27 +0900 Subject: [PATCH 6/8] fix windows --- crates/pyannote-local/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pyannote-local/Cargo.toml b/crates/pyannote-local/Cargo.toml index 3f09da6489..359686fd50 100644 --- a/crates/pyannote-local/Cargo.toml +++ b/crates/pyannote-local/Cargo.toml @@ -9,7 +9,7 @@ coreml = ["hypr-onnx/coreml"] directml = ["hypr-onnx/directml"] [dependencies] -hypr-onnx = { workspace = true, features = ["coreml"] } +hypr-onnx = { workspace = true } dasp = { workspace = true } knf-rs = { git = "https://github.com/thewh1teagle/pyannote-rs", rev = "d97bd3b", package = "knf-rs" } From aa1abae04e8ab725409ca56ba19dd98f8cf18e2c Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Mon, 23 Jun 2025 14:17:58 +0900 Subject: [PATCH 7/8] cleanup --- Cargo.lock | 79 ------------------------------- apps/app/server/Cargo.toml | 13 +---- apps/desktop/src-tauri/src/lib.rs | 1 + crates/chunker/Cargo.toml | 1 - crates/clova/Cargo.toml | 1 - crates/db-script/Cargo.toml | 2 - crates/db-user/Cargo.toml | 2 - crates/llama/Cargo.toml | 1 - crates/pyannote-cloud/Cargo.toml | 3 -- crates/rtzr/Cargo.toml | 13 ----- crates/stt/Cargo.toml | 6 --- crates/turso/Cargo.toml | 1 - crates/vad/Cargo.toml | 1 - crates/whisper-cloud/Cargo.toml | 4 -- crates/whisper-local/src/model.rs | 2 +- crates/ws/Cargo.toml | 1 - plugins/analytics/Cargo.toml | 2 - plugins/apple-calendar/Cargo.toml | 1 - plugins/auth/Cargo.toml | 2 - plugins/connector/Cargo.toml | 2 - plugins/db/Cargo.toml | 3 -- plugins/flags/Cargo.toml | 2 - plugins/local-llm/Cargo.toml | 2 - plugins/local-stt/Cargo.toml | 1 - plugins/misc/Cargo.toml | 5 -- plugins/notification/Cargo.toml | 3 -- plugins/sse/Cargo.toml | 2 - plugins/task/Cargo.toml | 1 - plugins/template/Cargo.toml | 2 - plugins/tray/Cargo.toml | 1 - 30 files changed, 3 insertions(+), 157 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 699a1b3b05..f407740163 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -517,27 +517,20 @@ dependencies = [ "anyhow", "apalis", "apalis-cron", - "async-stream", - "async-stripe", "auth-interface", "axum 0.8.4", - "buffer", "bytes", "calendar-google", "calendar-interface", - "calendar-outlook", "chrono", "clerk-rs", - "codes-iso-639", "db-admin", "db-core", "db-user", "dotenv", - "futures-core", "futures-util", "listener-interface", "nango", - "notion", "openai", "s3", "schemars", @@ -557,9 +550,7 @@ dependencies = [ "tracing-axiom", "tracing-subscriber", "turso", - "url", "uuid", - "ws-utils", ] [[package]] @@ -2424,7 +2415,6 @@ dependencies = [ "serde", "thiserror 2.0.12", "tokio", - "tracing", "vad", ] @@ -2572,7 +2562,6 @@ dependencies = [ "serde", "serde_json", "thiserror 2.0.12", - "tokio", "tonic 0.12.3", "tonic-build", "url", @@ -3365,7 +3354,6 @@ dependencies = [ "db-core", "libsql", "listener-interface", - "serde", "serde_json", "tokio", ] @@ -3377,7 +3365,6 @@ dependencies = [ "buffer", "calendar-interface", "chrono", - "codes-iso-639", "data", "db-core", "db-script", @@ -3390,7 +3377,6 @@ dependencies = [ "serde_json", "specta", "strum 0.26.3", - "thiserror 2.0.12", "tokio", "uuid", ] @@ -7823,7 +7809,6 @@ dependencies = [ "encoding_rs", "futures-util", "gbnf", - "gbnf-validator", "gguf", "listener-interface", "llama-cpp-2", @@ -9216,23 +9201,6 @@ dependencies = [ "asn1-rs", ] -[[package]] -name = "ollama-rs" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5df54edb7e1264719be607cd40590d3769b5b35a2623e6e02681e6591aea5b8" -dependencies = [ - "async-stream", - "log", - "reqwest 0.12.15", - "schemars", - "serde", - "serde_json", - "static_assertions", - "thiserror 2.0.12", - "url", -] - [[package]] name = "once_cell" version = "1.21.3" @@ -10369,13 +10337,11 @@ dependencies = [ name = "pyannote-cloud" version = "0.1.0" dependencies = [ - "anyhow", "data", "reqwest 0.12.15", "rodio", "serde", "specta", - "thiserror 2.0.12", "tokio", "url", ] @@ -11251,18 +11217,9 @@ dependencies = [ name = "rtzr" version = "0.1.0" dependencies = [ - "anyhow", - "bytes", - "futures-util", "prost 0.13.5", - "reqwest 0.12.15", - "serde", - "serde_json", - "thiserror 2.0.12", - "tokio", "tonic 0.12.3", "tonic-build", - "url", ] [[package]] @@ -12964,19 +12921,14 @@ dependencies = [ "audio-utils", "bytes", "clova", - "codes-iso-639", "data", - "db-user", "deepgram", "futures-util", "hound", "language", "listener-interface", - "rtzr", - "serde", "serde_json", "serial_test", - "specta", "thiserror 2.0.12", "tokio", "whisper-cloud", @@ -13455,7 +13407,6 @@ version = "0.1.0" dependencies = [ "analytics", "serde", - "serde_json", "specta", "specta-typescript", "strum 0.26.3", @@ -13465,7 +13416,6 @@ dependencies = [ "tauri-plugin-store2", "tauri-specta", "thiserror 2.0.12", - "tracing", ] [[package]] @@ -13479,7 +13429,6 @@ dependencies = [ "chrono", "db-user", "serde", - "serde_json", "specta", "specta-typescript", "tauri", @@ -13500,7 +13449,6 @@ dependencies = [ "base64 0.22.1", "keyring", "minijinja", - "schemars", "serde", "serde_json", "serde_qs 0.14.0", @@ -13565,8 +13513,6 @@ dependencies = [ "tauri-plugin-store2", "tauri-specta", "thiserror 2.0.12", - "tokio", - "tracing", "url", ] @@ -13578,17 +13524,14 @@ dependencies = [ "db-user", "listener-interface", "serde", - "serde_json", "specta", "specta-typescript", - "strum 0.26.3", "tauri", "tauri-plugin", "tauri-specta", "thiserror 2.0.12", "tokio", "tracing", - "turso", "uuid", ] @@ -13635,7 +13578,6 @@ name = "tauri-plugin-flags" version = "0.1.0" dependencies = [ "serde", - "serde_json", "specta", "specta-typescript", "strum 0.26.3", @@ -13644,7 +13586,6 @@ dependencies = [ "tauri-plugin-store2", "tauri-specta", "thiserror 2.0.12", - "tracing", ] [[package]] @@ -13761,7 +13702,6 @@ dependencies = [ "futures-util", "gbnf", "llama", - "ollama-rs", "reqwest 0.12.15", "serde", "serde_json", @@ -13788,7 +13728,6 @@ dependencies = [ "bytes", "chunker", "data", - "db-user", "dirs 6.0.0", "file", "futures-util", @@ -13864,16 +13803,12 @@ dependencies = [ "host", "indoc", "regex", - "serde", - "serde_json", "specta", "specta-typescript", - "strum 0.26.3", "tauri", "tauri-plugin", "tauri-plugin-opener", "tauri-specta", - "tracing", "vergen-gix", ] @@ -13886,10 +13821,8 @@ dependencies = [ "chrono", "db-user", "detect", - "keygen-rs", "notification2", "serde", - "serde_json", "specta", "specta-typescript", "strum 0.26.3", @@ -14063,13 +13996,11 @@ dependencies = [ "futures-util", "reqwest 0.12.15", "serde", - "serde_json", "specta", "specta-typescript", "tauri", "tauri-plugin", "tauri-specta", - "thiserror 2.0.12", "tokio", "tracing", ] @@ -14112,7 +14043,6 @@ dependencies = [ name = "tauri-plugin-task" version = "0.1.0" dependencies = [ - "chrono", "serde", "serde_json", "specta", @@ -14132,7 +14062,6 @@ name = "tauri-plugin-template" version = "0.1.0" dependencies = [ "insta", - "serde", "serde_json", "specta", "specta-typescript", @@ -14149,7 +14078,6 @@ version = "0.1.0" dependencies = [ "specta", "specta-typescript", - "strum 0.26.3", "tauri", "tauri-plugin", "tauri-plugin-windows", @@ -15260,7 +15188,6 @@ dependencies = [ "cached", "reqwest 0.12.15", "serde", - "serde_json", "thiserror 2.0.12", "tokio", "url", @@ -15654,7 +15581,6 @@ dependencies = [ "ort", "serde", "thiserror 2.0.12", - "tracing", ] [[package]] @@ -16158,7 +16084,6 @@ version = "0.1.0" dependencies = [ "audio-utils", "bytes", - "cpal", "data", "dirs 6.0.0", "futures-util", @@ -16167,10 +16092,7 @@ dependencies = [ "rodio", "serde", "serde_json", - "strum 0.26.3", - "thiserror 2.0.12", "tokio", - "tracing", "url", "whisper", "ws", @@ -17014,7 +16936,6 @@ dependencies = [ "bytes", "futures-util", "serde", - "serde_json", "thiserror 2.0.12", "tokio", "tokio-tungstenite 0.26.2", diff --git a/apps/app/server/Cargo.toml b/apps/app/server/Cargo.toml index b2f4e33e0c..fb86901af9 100644 --- a/apps/app/server/Cargo.toml +++ b/apps/app/server/Cargo.toml @@ -10,26 +10,19 @@ dotenv = { workspace = true } hypr-auth-interface = { workspace = true } hypr-listener-interface = { workspace = true } +futures-util = { workspace = true } hypr-analytics = { workspace = true } -hypr-buffer = { workspace = true } hypr-calendar-google = { workspace = true } hypr-calendar-interface = { workspace = true } -hypr-calendar-outlook = { workspace = true } hypr-db-admin = { workspace = true } hypr-db-core = { workspace = true } hypr-db-user = { workspace = true } hypr-nango = { workspace = true } -hypr-notion = { workspace = true } hypr-openai = { workspace = true } hypr-s3 = { workspace = true } hypr-slack = { workspace = true } hypr-stt = { workspace = true, features = ["realtime", "recorded"] } hypr-turso = { workspace = true } -hypr-ws-utils = { workspace = true } - -async-stream = { workspace = true } -futures-core = { workspace = true } -futures-util = { workspace = true } tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } axum = { workspace = true, features = ["ws"] } @@ -47,10 +40,8 @@ tracing-subscriber = { workspace = true, features = ["env-filter"] } anyhow = { workspace = true } bytes = { workspace = true } chrono = { workspace = true } -codes-iso-639 = { workspace = true } dotenv = { workspace = true } thiserror = { workspace = true } -url = { workspace = true } uuid = { workspace = true } serde = { workspace = true, features = ["derive"] } @@ -62,6 +53,4 @@ specta-typescript = { workspace = true } apalis = { workspace = true, features = ["sentry", "limit"] } apalis-cron = { workspace = true } - -async-stripe = { workspace = true, default-features = false, features = ["runtime-tokio-hyper", "webhook-events", "checkout", "connect"] } clerk-rs = { git = "https://github.com/DarrenBaldwin07/clerk-rs", rev = "6f1d312", features = ["axum"] } diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs index 2db5cda4c7..15114eabbb 100644 --- a/apps/desktop/src-tauri/src/lib.rs +++ b/apps/desktop/src-tauri/src/lib.rs @@ -87,6 +87,7 @@ pub async fn main() { .plugin(tauri_plugin_auth::init()) .plugin(tauri_plugin_clipboard_manager::init()) .plugin(tauri_plugin_shell::init()) + .plugin(tauri_plugin_task::init()) .plugin(tauri_plugin_http::init()) .plugin(tauri_plugin_machine_uid::init()) .plugin(tauri_plugin_analytics::init()) diff --git a/crates/chunker/Cargo.toml b/crates/chunker/Cargo.toml index a1a222bcac..ea862bc808 100644 --- a/crates/chunker/Cargo.toml +++ b/crates/chunker/Cargo.toml @@ -16,4 +16,3 @@ futures-util = { workspace = true } serde = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } -tracing = { workspace = true } diff --git a/crates/clova/Cargo.toml b/crates/clova/Cargo.toml index ca63dee060..db39fe8f0b 100644 --- a/crates/clova/Cargo.toml +++ b/crates/clova/Cargo.toml @@ -18,7 +18,6 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } futures-util = { workspace = true } -tokio = { workspace = true } prost = { workspace = true } tonic = { workspace = true, features = ["channel", "tls-native-roots"] } diff --git a/crates/db-script/Cargo.toml b/crates/db-script/Cargo.toml index 31297695da..ae74a4a9c5 100644 --- a/crates/db-script/Cargo.toml +++ b/crates/db-script/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" [dependencies] hypr-listener-interface = { workspace = true } libsql = { workspace = true } - -serde = { workspace = true } serde_json = { workspace = true } [dev-dependencies] diff --git a/crates/db-user/Cargo.toml b/crates/db-user/Cargo.toml index 458d09069c..f678f94e1f 100644 --- a/crates/db-user/Cargo.toml +++ b/crates/db-user/Cargo.toml @@ -23,7 +23,5 @@ schemars = { workspace = true, features = ["chrono"] } specta = { workspace = true, features = ["derive", "chrono", "serde_json"] } chrono = { workspace = true, features = ["serde"] } -codes-iso-639 = { workspace = true } indoc = { workspace = true } -thiserror = { workspace = true } uuid = { workspace = true, features = ["v4", "serde"] } diff --git a/crates/llama/Cargo.toml b/crates/llama/Cargo.toml index ffae8b46d6..5c2153f4e9 100644 --- a/crates/llama/Cargo.toml +++ b/crates/llama/Cargo.toml @@ -16,7 +16,6 @@ openmp = ["llama-cpp-2/openmp"] hypr-gguf = { workspace = true } encoding_rs = "0.8.35" -gbnf-validator = { workspace = true } llama-cpp-2 = { git = "https://github.com/utilityai/llama-cpp-rs", default-features = false, branch = "update-llama-cpp-2025-05-28" } async-openai = { workspace = true } diff --git a/crates/pyannote-cloud/Cargo.toml b/crates/pyannote-cloud/Cargo.toml index 52746e8ee3..89e4d602fb 100644 --- a/crates/pyannote-cloud/Cargo.toml +++ b/crates/pyannote-cloud/Cargo.toml @@ -7,9 +7,6 @@ edition = "2021" reqwest = { workspace = true, features = ["json"] } url = { workspace = true } -anyhow = { workspace = true } -thiserror = { workspace = true } - serde = { workspace = true, features = ["derive"] } specta = { workspace = true, features = ["derive"] } diff --git a/crates/rtzr/Cargo.toml b/crates/rtzr/Cargo.toml index a4dc214502..c8cdfaf26c 100644 --- a/crates/rtzr/Cargo.toml +++ b/crates/rtzr/Cargo.toml @@ -10,18 +10,5 @@ generate = [] tonic-build = { workspace = true } [dependencies] -anyhow = { workspace = true } -thiserror = { workspace = true } - -bytes = { workspace = true } -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } - -futures-util = { workspace = true } -tokio = { workspace = true } - prost = { workspace = true } tonic = { workspace = true, features = ["channel", "tls-native-roots"] } - -reqwest = { workspace = true, features = ["multipart", "stream", "json"] } -url = { workspace = true } diff --git a/crates/stt/Cargo.toml b/crates/stt/Cargo.toml index 974848ef66..76aa08fbb8 100644 --- a/crates/stt/Cargo.toml +++ b/crates/stt/Cargo.toml @@ -12,10 +12,8 @@ local = [] [dependencies] hypr-audio-utils = { workspace = true } hypr-clova = { workspace = true } -hypr-db-user = { workspace = true } hypr-language = { workspace = true, features = ["deepgram", "whisper"] } hypr-listener-interface = { workspace = true } -hypr-rtzr = { workspace = true } hypr-whisper-cloud = { workspace = true } deepgram = { workspace = true, default-features = false, features = ["listen"] } @@ -24,11 +22,7 @@ anyhow = { workspace = true } thiserror = { workspace = true } bytes = { workspace = true } -codes-iso-639 = { workspace = true } - -serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } -specta = { workspace = true, features = ["derive"] } futures-util = { workspace = true } tokio = { workspace = true } diff --git a/crates/turso/Cargo.toml b/crates/turso/Cargo.toml index d18bcbb2c9..c577420e3d 100644 --- a/crates/turso/Cargo.toml +++ b/crates/turso/Cargo.toml @@ -7,7 +7,6 @@ edition = "2021" cached = { workspace = true } reqwest = { workspace = true, features = ["json"] } serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } thiserror = { workspace = true } url = { workspace = true } diff --git a/crates/vad/Cargo.toml b/crates/vad/Cargo.toml index 2fb621fc37..c29ace3691 100644 --- a/crates/vad/Cargo.toml +++ b/crates/vad/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" [dependencies] serde = { workspace = true } thiserror = { workspace = true } -tracing = { workspace = true } ndarray = "0.16" ort = "=2.0.0-rc.9" diff --git a/crates/whisper-cloud/Cargo.toml b/crates/whisper-cloud/Cargo.toml index 0a73a1d404..5f179b90d1 100644 --- a/crates/whisper-cloud/Cargo.toml +++ b/crates/whisper-cloud/Cargo.toml @@ -17,13 +17,9 @@ hypr-whisper = { workspace = true } hypr-ws = { workspace = true } bytes = { workspace = true } -cpal = { workspace = true } futures-util = { workspace = true } kalosm-sound = { workspace = true, default-features = false } rodio = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -strum = { workspace = true, features = ["derive"] } -thiserror = { workspace = true } -tracing = { workspace = true } url = { workspace = true } diff --git a/crates/whisper-local/src/model.rs b/crates/whisper-local/src/model.rs index f1f089e3cf..22c5cd529a 100644 --- a/crates/whisper-local/src/model.rs +++ b/crates/whisper-local/src/model.rs @@ -44,7 +44,7 @@ impl WhisperBuilder { } pub fn build(self) -> Whisper { - if cfg!(debug_assertions) { + if !cfg!(debug_assertions) { unsafe { Self::suppress_log() }; } diff --git a/crates/ws/Cargo.toml b/crates/ws/Cargo.toml index 6cc559af7e..dec5683c82 100644 --- a/crates/ws/Cargo.toml +++ b/crates/ws/Cargo.toml @@ -11,7 +11,6 @@ server = [] [dependencies] bytes = { workspace = true } serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } thiserror = { workspace = true } async-stream = { workspace = true } diff --git a/plugins/analytics/Cargo.toml b/plugins/analytics/Cargo.toml index c2c2368e64..0a17505b43 100644 --- a/plugins/analytics/Cargo.toml +++ b/plugins/analytics/Cargo.toml @@ -23,9 +23,7 @@ tauri = { workspace = true, features = ["test"] } tauri-specta = { workspace = true, features = ["derive", "typescript"] } serde = { workspace = true } -serde_json = { workspace = true } specta = { workspace = true } strum = { workspace = true, features = ["derive"] } thiserror = { workspace = true } -tracing = { workspace = true } diff --git a/plugins/apple-calendar/Cargo.toml b/plugins/apple-calendar/Cargo.toml index 1115577527..44dff5ef0c 100644 --- a/plugins/apple-calendar/Cargo.toml +++ b/plugins/apple-calendar/Cargo.toml @@ -24,7 +24,6 @@ tauri = { workspace = true, features = ["test"] } tauri-specta = { workspace = true, features = ["derive", "typescript"] } serde = { workspace = true } -serde_json = { workspace = true } specta = { workspace = true } chrono = { workspace = true } diff --git a/plugins/auth/Cargo.toml b/plugins/auth/Cargo.toml index 124fbbccb2..e01dab688d 100644 --- a/plugins/auth/Cargo.toml +++ b/plugins/auth/Cargo.toml @@ -23,8 +23,6 @@ tauri-specta = { workspace = true, features = ["derive", "typescript"] } keyring = { version = "3", features = ["apple-native", "windows-native", "sync-secret-service"] } minijinja = { workspace = true } - -schemars = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } serde_qs = { workspace = true } diff --git a/plugins/connector/Cargo.toml b/plugins/connector/Cargo.toml index 590f78cddc..62b804e8a9 100644 --- a/plugins/connector/Cargo.toml +++ b/plugins/connector/Cargo.toml @@ -29,6 +29,4 @@ serde_json = { workspace = true } specta = { workspace = true } strum = { workspace = true, features = ["derive"] } thiserror = { workspace = true } -tokio = { workspace = true } -tracing = { workspace = true } url = { workspace = true } diff --git a/plugins/db/Cargo.toml b/plugins/db/Cargo.toml index edec33fea9..20da6cf518 100644 --- a/plugins/db/Cargo.toml +++ b/plugins/db/Cargo.toml @@ -17,15 +17,12 @@ specta-typescript = { workspace = true } hypr-db-core = { workspace = true } hypr-db-user = { workspace = true } hypr-listener-interface = { workspace = true } -hypr-turso = { workspace = true } specta = { workspace = true } tauri = { workspace = true, features = ["test"] } tauri-specta = { workspace = true, features = ["derive", "typescript"] } serde = { workspace = true } -serde_json = { workspace = true } -strum = { workspace = true, features = ["derive"] } thiserror = { workspace = true } uuid = { workspace = true } diff --git a/plugins/flags/Cargo.toml b/plugins/flags/Cargo.toml index 78a84ba6f2..f2cd7f4f99 100644 --- a/plugins/flags/Cargo.toml +++ b/plugins/flags/Cargo.toml @@ -19,9 +19,7 @@ tauri-plugin-store2 = { workspace = true } tauri-specta = { workspace = true, features = ["derive", "typescript"] } serde = { workspace = true } -serde_json = { workspace = true } specta = { workspace = true } strum = { workspace = true, features = ["derive"] } thiserror = { workspace = true } -tracing = { workspace = true } diff --git a/plugins/local-llm/Cargo.toml b/plugins/local-llm/Cargo.toml index 4acb44487a..7664899035 100644 --- a/plugins/local-llm/Cargo.toml +++ b/plugins/local-llm/Cargo.toml @@ -47,5 +47,3 @@ futures-util = { workspace = true } reqwest = { workspace = true, features = ["stream"] } tokio = { workspace = true, features = ["rt", "macros"] } tower-http = { workspace = true, features = ["cors", "trace"] } - -ollama-rs = "0.2.6" diff --git a/plugins/local-stt/Cargo.toml b/plugins/local-stt/Cargo.toml index 587001066d..30b70d73be 100644 --- a/plugins/local-stt/Cargo.toml +++ b/plugins/local-stt/Cargo.toml @@ -37,7 +37,6 @@ tracing = { workspace = true } [dependencies] hypr-audio-utils = { workspace = true } hypr-chunker = { workspace = true } -hypr-db-user = { workspace = true } hypr-file = { workspace = true } hypr-listener-interface = { workspace = true } hypr-pyannote-local = { workspace = true } diff --git a/plugins/misc/Cargo.toml b/plugins/misc/Cargo.toml index 60277a8737..6a455ec0a9 100644 --- a/plugins/misc/Cargo.toml +++ b/plugins/misc/Cargo.toml @@ -24,10 +24,5 @@ tauri = { workspace = true, features = ["test"] } tauri-plugin-opener = { workspace = true } tauri-specta = { workspace = true, features = ["derive", "typescript"] } -tracing = { workspace = true } - regex = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } specta = { workspace = true } -strum = { workspace = true, features = ["derive"] } diff --git a/plugins/notification/Cargo.toml b/plugins/notification/Cargo.toml index bddf981d6f..bbe41a200c 100644 --- a/plugins/notification/Cargo.toml +++ b/plugins/notification/Cargo.toml @@ -23,7 +23,6 @@ tauri-plugin-db = { workspace = true } tauri-plugin-store2 = { workspace = true } serde = { workspace = true } -serde_json = { workspace = true } specta = { workspace = true } strum = { workspace = true, features = ["derive"] } thiserror = { workspace = true } @@ -37,5 +36,3 @@ tauri-specta = { workspace = true, features = ["derive", "typescript"] } apalis = { workspace = true } apalis-cron = { workspace = true } chrono = { workspace = true } - -keygen-rs = { version = "0.4.3", default-features = false, features = ["native-tls"] } diff --git a/plugins/sse/Cargo.toml b/plugins/sse/Cargo.toml index 964a6faf8f..a63cb2fdee 100644 --- a/plugins/sse/Cargo.toml +++ b/plugins/sse/Cargo.toml @@ -25,5 +25,3 @@ reqwest = { workspace = true, features = ["stream"] } tracing = { workspace = true } serde = { workspace = true } -serde_json = { workspace = true } -thiserror = { workspace = true } diff --git a/plugins/task/Cargo.toml b/plugins/task/Cargo.toml index e3041cb9ae..47de0b3222 100644 --- a/plugins/task/Cargo.toml +++ b/plugins/task/Cargo.toml @@ -19,7 +19,6 @@ tauri = { workspace = true, features = ["test"] } tauri-plugin-store2 = { workspace = true } tauri-specta = { workspace = true, features = ["derive", "typescript"] } -chrono = { workspace = true, features = ["serde"] } serde = { workspace = true } serde_json = { workspace = true } specta = { workspace = true } diff --git a/plugins/template/Cargo.toml b/plugins/template/Cargo.toml index 07a2d8a259..d2eecac4cc 100644 --- a/plugins/template/Cargo.toml +++ b/plugins/template/Cargo.toml @@ -16,8 +16,6 @@ specta-typescript = { workspace = true } [dependencies] hypr-template = { workspace = true } - -serde = { workspace = true } serde_json = { workspace = true } tracing = { workspace = true } diff --git a/plugins/tray/Cargo.toml b/plugins/tray/Cargo.toml index 4e3c98261e..81e8841184 100644 --- a/plugins/tray/Cargo.toml +++ b/plugins/tray/Cargo.toml @@ -18,5 +18,4 @@ tauri = { workspace = true, features = ["tray-icon", "image-png"] } tauri-plugin-windows = { workspace = true } specta = { workspace = true } -strum = { workspace = true, features = ["derive"] } tauri-specta = { workspace = true, features = ["derive", "typescript"] } From 7d48fcd29d76517093fcbba8e546082ecddaf770 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Mon, 23 Jun 2025 16:49:50 +0900 Subject: [PATCH 8/8] fix build --- Cargo.lock | 1 + apps/app/server/Cargo.toml | 2 ++ crates/stt/Cargo.toml | 7 +++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f407740163..e8442271b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -517,6 +517,7 @@ dependencies = [ "anyhow", "apalis", "apalis-cron", + "async-stripe", "auth-interface", "axum 0.8.4", "bytes", diff --git a/apps/app/server/Cargo.toml b/apps/app/server/Cargo.toml index fb86901af9..ab5150d2f5 100644 --- a/apps/app/server/Cargo.toml +++ b/apps/app/server/Cargo.toml @@ -53,4 +53,6 @@ specta-typescript = { workspace = true } apalis = { workspace = true, features = ["sentry", "limit"] } apalis-cron = { workspace = true } + +async-stripe = { workspace = true, default-features = false, features = ["runtime-tokio-hyper", "webhook-events", "checkout", "connect"] } clerk-rs = { git = "https://github.com/DarrenBaldwin07/clerk-rs", rev = "6f1d312", features = ["axum"] } diff --git a/crates/stt/Cargo.toml b/crates/stt/Cargo.toml index 76aa08fbb8..a877d0c93d 100644 --- a/crates/stt/Cargo.toml +++ b/crates/stt/Cargo.toml @@ -4,10 +4,9 @@ version = "0.1.0" edition = "2021" [features] -default = ["realtime", "recorded", "local"] +default = ["realtime", "recorded"] realtime = [] recorded = [] -local = [] [dependencies] hypr-audio-utils = { workspace = true } @@ -28,8 +27,8 @@ futures-util = { workspace = true } tokio = { workspace = true } [dev-dependencies] -hypr-audio = { path = "../audio", package = "audio" } -hypr-data = { path = "../data", package = "data" } +hypr-audio = { workspace = true } +hypr-data = { workspace = true } async-stream = { workspace = true } hound = { workspace = true }