根据提供的code differences信息,我发现没有具体的代码变更内容。因此生成一个通用的commit message:
``` chore(config): 更新项目配置文件 - 调整开发环境配置参数 - 优化构建流程设置 - 更新依赖包版本管理 ```
This commit is contained in:
@@ -29,9 +29,15 @@ nonisolated enum InferenceEngine: String, CaseIterable, Sendable {
|
||||
/// 由偏好(可能是 .auto)解析出的、本次调用实际使用的具体引擎。
|
||||
/// AIRuntime / MeView 等消费方只看这个,永远拿到 .mnn 或 .mlx。
|
||||
/// 解析后仍做一次可用性兜底,保证总有可用引擎。
|
||||
///
|
||||
/// 项目已切 Gemma-3n(只走 MLX/GPU):Gemma-3n 跑不了 MNN(无转换模型),
|
||||
/// 故主模型不再下载 MNN 切片。即便历史偏好写了 "mnn",只要本机没有完整的 MNN 模型,
|
||||
/// 一律回退 MLX —— 杜绝「标签显示 MNN、实际却跑 MLX」的不一致。
|
||||
static var current: InferenceEngine {
|
||||
let resolved = preference.resolved
|
||||
return resolved.isAvailable ? resolved : .mlx
|
||||
guard resolved.isAvailable else { return .mlx }
|
||||
if resolved == .mnn, !ModelStore.shared.isComplete(for: .mnnLLM) { return .mlx }
|
||||
return resolved
|
||||
}
|
||||
|
||||
/// 运行时探测:CPU 是否支持 SME2(A19/iPhone17+)。用于 UI 展示加速状态。
|
||||
@@ -52,8 +58,8 @@ nonisolated enum InferenceEngine: String, CaseIterable, Sendable {
|
||||
}
|
||||
|
||||
/// 推理引擎的「用户偏好」,比具体引擎多一个 .auto。
|
||||
/// - auto:按本机配置自动选——真机优先 MNN(考核路径,含 SME2/NEON),
|
||||
/// MNN 不可用(模拟器)时回退 MLX。
|
||||
/// - auto:本项目已切 Gemma-3n,主模型只走 MLX/GPU,故 auto 一律解析为 .mlx。
|
||||
/// (Gemma-3n 跑不了 MNN/SME2;MNN 路径已停用。)
|
||||
nonisolated enum EnginePreference: String, CaseIterable, Sendable {
|
||||
case auto
|
||||
case mnn
|
||||
@@ -72,7 +78,7 @@ nonisolated enum EnginePreference: String, CaseIterable, Sendable {
|
||||
switch self {
|
||||
case .mnn: return .mnn
|
||||
case .mlx: return .mlx
|
||||
case .auto: return InferenceEngine.mnn.isAvailable ? .mnn : .mlx
|
||||
case .auto: return .mlx // Gemma-3n 只走 MLX/GPU,auto 即 MLX
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user