refactor(goose-local-inference): move mlx deps under macos (#11328)
This commit is contained in:
@@ -45,12 +45,11 @@ tracing = { workspace = true }
|
||||
uuid = { workspace = true, features = ["v4", "std"] }
|
||||
tempfile = { workspace = true }
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
llama-cpp-2 = { workspace = true, features = ["sampler", "metal", "mtmd"] }
|
||||
safemlx = { default-features = false, features = ["accelerate", "metal", "safetensors"], optional = true, version = "0.1.2" }
|
||||
safemlx-lm = { optional = true, version = "0.1.5" }
|
||||
safemlx-lm-utils = { optional = true, version = "0.1.2" }
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
llama-cpp-2 = { workspace = true, features = ["sampler", "metal", "mtmd"] }
|
||||
|
||||
[dev-dependencies]
|
||||
env-lock.workspace = true
|
||||
|
||||
@@ -1842,14 +1842,14 @@ fn mlx_config_support(config: &Option<serde_json::Value>) -> Option<String> {
|
||||
mlx_config_support_for_value(config)
|
||||
}
|
||||
|
||||
#[cfg(feature = "mlx")]
|
||||
#[cfg(all(feature = "mlx", target_os = "macos"))]
|
||||
fn mlx_config_support_for_value(config: &serde_json::Value) -> Option<String> {
|
||||
safemlx_lm::check_model_config(config)
|
||||
.unsupported_reason()
|
||||
.map(str::to_string)
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "mlx"))]
|
||||
#[cfg(not(all(feature = "mlx", target_os = "macos")))]
|
||||
fn mlx_config_support_for_value(_config: &serde_json::Value) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#[cfg(feature = "mlx")]
|
||||
#[cfg(all(feature = "mlx", target_os = "macos"))]
|
||||
mod imp {
|
||||
use std::any::Any;
|
||||
use std::path::{Path, PathBuf};
|
||||
@@ -990,7 +990,7 @@ mod imp {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "mlx"))]
|
||||
#[cfg(not(all(feature = "mlx", target_os = "macos")))]
|
||||
mod imp {
|
||||
use crate::backend::{BackendLoadedModel, LocalGenerationRequest, LocalInferenceBackend};
|
||||
use crate::local_model_registry::ModelSettings;
|
||||
|
||||
Reference in New Issue
Block a user