Skip to content

Commit 76bd3fe

Browse files
committed
exclude cactus in non-arm cli build
Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
1 parent b1802ce commit 76bd3fe

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

apps/cli/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ hypr-listener-core = { workspace = true }
3131
hypr-listener2-core = { workspace = true }
3232
hypr-local-model = { workspace = true }
3333
hypr-local-stt-core = { workspace = true }
34-
hypr-local-stt-server = { workspace = true }
3534
hypr-model-downloader = { workspace = true }
3635
hypr-openrouter = { workspace = true }
3736
hypr-storage = { workspace = true }
@@ -85,6 +84,9 @@ uuid = { workspace = true, features = ["v4"] }
8584
[target.'cfg(target_os = "macos")'.dependencies]
8685
hypr-apple-calendar = { workspace = true }
8786

87+
[target.'cfg(any(target_arch = "arm", target_arch = "aarch64"))'.dependencies]
88+
hypr-local-stt-server = { workspace = true }
89+
8890
[dev-dependencies]
8991
clap_complete = { workspace = true }
9092
cli-docs = { path = "../../crates/cli-docs" }

apps/cli/src/commands/debug/transcribe/runtime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ async fn run_resolved_provider<A: RealtimeSttAdapter>(
190190
tx: mpsc::UnboundedSender<RuntimeEvent>,
191191
) -> CliResult<()> {
192192
// keep local server alive for the duration of this scope
193-
let _ = resolved.server.as_ref();
193+
let _ = &resolved.server;
194194
let audio: Arc<dyn AudioProvider> = create_audio_provider(&source);
195195
let mut params = default_listen_params();
196196
params.languages = vec![resolved.language.clone()];

apps/cli/src/commands/transcribe/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub async fn run_batch(
9494
stt.language,
9595
)
9696
.await?;
97-
let _ = resolved.server.as_ref();
97+
let _ = &resolved.server;
9898

9999
let file_path = input.path().to_str().ok_or_else(|| {
100100
CliError::invalid_argument(

apps/cli/src/config/stt.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@ use std::path::PathBuf;
22

33
use hypr_listener2_core::{BatchEvent, BatchParams, BatchProvider, BatchRuntime};
44
use hypr_local_model::{CactusSttModel, LocalModel};
5+
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
56
use hypr_local_stt_server::LocalSttServer;
67
use tokio::sync::mpsc;
78

89
use crate::cli::Provider;
910
use crate::config::paths;
1011
use crate::error::{CliError, CliResult, did_you_mean};
1112

13+
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
14+
pub(crate) type ServerGuard = Option<hypr_local_stt_server::LocalSttServer>;
15+
16+
#[cfg(not(any(target_arch = "arm", target_arch = "aarch64")))]
17+
pub(crate) type ServerGuard = ();
18+
1219
pub struct SttGlobalArgs {
1320
pub provider: Provider,
1421
pub base_url: Option<String>,
@@ -67,6 +74,7 @@ impl Provider {
6774
}
6875
}
6976

77+
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
7078
pub struct CactusServerInfo {
7179
pub server: LocalSttServer,
7280
pub base_url: String,
@@ -79,7 +87,7 @@ pub struct ResolvedSttConfig {
7987
pub api_key: String,
8088
pub model: String,
8189
pub language: hypr_language::Language,
82-
pub server: Option<LocalSttServer>,
90+
pub server: ServerGuard,
8391
}
8492

8593
impl ResolvedSttConfig {
@@ -124,6 +132,7 @@ pub async fn resolve_config(
124132

125133
let batch_provider = provider.to_batch_provider();
126134

135+
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
127136
if provider.is_local() {
128137
let info = resolve_and_spawn_cactus(model.as_deref()).await?;
129138
return Ok(ResolvedSttConfig {
@@ -152,7 +161,7 @@ pub async fn resolve_config(
152161
api_key,
153162
model: model.unwrap_or_default(),
154163
language,
155-
server: None,
164+
server: ServerGuard::default(),
156165
});
157166
}
158167

@@ -167,10 +176,11 @@ pub async fn resolve_config(
167176
api_key,
168177
model: model.unwrap_or_default(),
169178
language,
170-
server: None,
179+
server: ServerGuard::default(),
171180
})
172181
}
173182

183+
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
174184
pub async fn resolve_and_spawn_cactus(model_name: Option<&str>) -> CliResult<CactusServerInfo> {
175185
let (model, model_path) = resolve_cactus_model(model_name)?;
176186

0 commit comments

Comments
 (0)