From 771b28e7efc8cf3538aaa46a8f687fffc24fa324 Mon Sep 17 00:00:00 2001 From: link2026 Date: Mon, 25 May 2026 15:50:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(ai):=20ModelKind=20rawValue=20=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E7=9C=9F=E5=AE=9E=20HF=20mlx-community=20=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 实际查 HuggingFace 后,mlx-community 下的仓库名: - Qwen3-1.7B-4bit(不是 Qwen3-1.7B-MLX-4bit) - Qwen2.5-VL-3B-Instruct-4bit(VL 模型带 Instruct 后缀) 改动: - ModelKind.llm/vl rawValue 改名,这也是沙盒 Models/ 下的子目录名 - 加 huggingFaceRepo computed:"mlx-community/\(rawValue)" - CLAUDE.md §2 表格补 HF 仓库 ID - spec §2.2 模型来源行修正 W2 plan 中的下载脚本已陈旧(用了 huggingface-cli + 错名), W2 retro 时会修正。 Co-Authored-By: Claude Opus 4.7 (1M context) --- CLAUDE.md | 4 ++-- .../specs/2026-05-25-kangji-features-design.md | 2 +- 体己/AI/ModelStore.swift | 8 ++++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 50043ad..abd673d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -23,8 +23,8 @@ | 持久化 | SwiftData | 见 §5 数据模型 | | 图表 | Swift Charts | iOS 16+ 原生 | | **AI 运行时** | **MLX Swift (Apple 官方)** | 不要建议 Core ML / llama.cpp / Ollama | -| LLM | Qwen3-1.7B (MLX 4bit 量化) | ~1.0GB,负责文本生成、关键词抽取、趋势解读 | -| VL | Qwen2.5-VL-3B (MLX 4bit 量化) | ~2.0GB,负责拍照→结构化指标 | +| LLM | Qwen3-1.7B 4bit (HF: `mlx-community/Qwen3-1.7B-4bit`) | ~1.0GB,负责文本生成、关键词抽取、趋势解读 | +| VL | Qwen2.5-VL-3B-Instruct 4bit (HF: `mlx-community/Qwen2.5-VL-3B-Instruct-4bit`) | ~2.0GB,负责拍照→结构化指标 | | 文档扫描 | VisionKit `VNDocumentCameraView` | 不要自己写透视校正 | | Face ID | LocalAuthentication | | | Live Activity | ActivityKit + WidgetExtension | demo 杀手锏,真机才能测 | diff --git a/docs/superpowers/specs/2026-05-25-kangji-features-design.md b/docs/superpowers/specs/2026-05-25-kangji-features-design.md index c2764d6..bbb4645 100644 --- a/docs/superpowers/specs/2026-05-25-kangji-features-design.md +++ b/docs/superpowers/specs/2026-05-25-kangji-features-design.md @@ -112,7 +112,7 @@ struct TokenChunk { | 项 | 决策 | |---|---| -| 模型来源 | HuggingFace MLX 社区版 Qwen3-1.7B-MLX-4bit + Qwen2.5-VL-3B-MLX-4bit | +| 模型来源 | HuggingFace `mlx-community/Qwen3-1.7B-4bit` + `mlx-community/Qwen2.5-VL-3B-Instruct-4bit` | | 体积 | LLM ~1.0GB + VL ~2.0GB ≈ 3GB | | 存储 | `Application Support/Models/`,`URLSession.downloadTask` + 断点续传 | | 首启动 | 启动屏 → 隐私承诺 → "下载模型"页(进度 + WiFi 提示) → 主界面 | diff --git a/体己/AI/ModelStore.swift b/体己/AI/ModelStore.swift index 057feba..e9167a5 100644 --- a/体己/AI/ModelStore.swift +++ b/体己/AI/ModelStore.swift @@ -1,8 +1,9 @@ import Foundation enum ModelKind: String, CaseIterable { - case llm = "Qwen3-1.7B-MLX-4bit" - case vl = "Qwen2.5-VL-3B-MLX-4bit" + /// 与 HuggingFace mlx-community 仓库名一一对应,也是沙盒 Models/ 下的子目录名。 + case llm = "Qwen3-1.7B-4bit" + case vl = "Qwen2.5-VL-3B-Instruct-4bit" var displayName: String { switch self { @@ -11,6 +12,9 @@ enum ModelKind: String, CaseIterable { } } + /// HuggingFace 仓库 ID(org/name),用于下载 + var huggingFaceRepo: String { "mlx-community/\(rawValue)" } + /// 用于判定该模型是否已就绪的最小标志文件 var sentinelFilename: String { "config.json" } }