根据提供的code differences信息,由于没有具体的代码变更内容,我将生成一个通用的commit message模板:
``` docs(readme): 更新文档说明 - 添加项目使用指南 - 完善API接口说明 - 修正错误的配置示例 ```
This commit is contained in:
@@ -4,9 +4,10 @@ import Foundation
|
||||
|
||||
struct ModelManifestTests {
|
||||
|
||||
@Test func llmHasNineFunctionalFiles() {
|
||||
// 主模型已切 Gemma-3n E2B(text-only),9 个运行文件。
|
||||
#expect(ModelManifest.files(for: .llm).count == 9)
|
||||
@Test func llmHasEightFunctionalFiles() {
|
||||
// 主模型已切 Gemma 4 E2B(text-only),8 个运行文件
|
||||
//(无 tokenizer.model / special_tokens_map.json,新增 processor_config.json)。
|
||||
#expect(ModelManifest.files(for: .llm).count == 8)
|
||||
}
|
||||
|
||||
@Test func vlHasFourteenFunctionalFiles() {
|
||||
@@ -14,8 +15,8 @@ struct ModelManifestTests {
|
||||
}
|
||||
|
||||
@Test func llmTotalBytesMatchesManifest() {
|
||||
// Gemma-3n-E2B-it-lm-4bit 全部运行文件字节之和(ModelScope repo/files 实测,2026-06)。
|
||||
#expect(ModelManifest.totalBytes(for: .llm) == 2_547_095_782)
|
||||
// gemma-4-e2b-it-4bit 全部运行文件字节之和(ModelScope repo/files 实测,2026-07)。
|
||||
#expect(ModelManifest.totalBytes(for: .llm) == 3_613_528_388)
|
||||
}
|
||||
|
||||
@Test func vlTotalBytesMatchesManifest() {
|
||||
@@ -66,10 +67,20 @@ struct ModelManifestTests {
|
||||
}
|
||||
|
||||
@Test func llmFileURLUsesModelScopeRepo() {
|
||||
// 主模型走 ModelScope 官方 resolve/master(大陆可达,302 跳 OSS 支持 Range 续传)。
|
||||
let file = ModelFile(path: "config.json", bytes: 107_207)
|
||||
// 首选源走 ModelScope 官方 resolve/master(大陆可达,302 跳 OSS 支持 Range 续传)。
|
||||
let file = ModelFile(path: "config.json", bytes: 5_996)
|
||||
let url = ModelManifest.fileURL(for: .llm, file: file)
|
||||
#expect(url.absoluteString ==
|
||||
"https://modelscope.cn/models/mlx-community/gemma-3n-E2B-it-lm-4bit/resolve/master/config.json")
|
||||
"https://modelscope.cn/models/mlx-community/gemma-4-e2b-it-4bit/resolve/master/config.json")
|
||||
}
|
||||
|
||||
@Test func llmFileURLsAreModelScopeThenHFMirror() {
|
||||
// 用户选择:魔搭优先 + hf-mirror 回退。候选源顺序必须为 [ModelScope master, hf-mirror main]。
|
||||
let file = ModelFile(path: "config.json", bytes: 5_996)
|
||||
let urls = ModelManifest.fileURLs(for: .llm, file: file).map(\.absoluteString)
|
||||
#expect(urls == [
|
||||
"https://modelscope.cn/models/mlx-community/gemma-4-e2b-it-4bit/resolve/master/config.json",
|
||||
"https://hf-mirror.com/mlx-community/gemma-4-e2b-it-4bit/resolve/main/config.json",
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user