diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dac6421b..10562bc0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,12 +94,17 @@ jobs: - name: Lint run: swift format lint --strict --recursive . - - name: Remove cached build descriptions + - name: Remove cached build descriptions and Swift-imported modules # Descriptions contain Metal compiler paths # from the previous runner's temporary mount. - # Keep compiled outputs for incremental builds. + # A binary target's headers keep their release's timestamps, + # so Swift Build reuses a module built from an older release's headers. + # llama.swift isn't pinned, so this can happen with an exact cache hit. + # Keep the other compiled outputs for incremental builds. if: matrix.swift == '6.4' - run: rm -rf .build/out/Intermediates.noindex/XCBuildData/*.xcbuilddata + run: | + rm -rf .build/out/Intermediates.noindex/XCBuildData/*.xcbuilddata + rm -rf .build/out/Intermediates.noindex/SwiftExplicitPrecompiledModules # Nothing in these jobs reads the index store. # The Linux jobs keep it because test discovery on Linux reads it. diff --git a/Package.swift b/Package.swift index 5b9cbc4b..241cf195 100644 --- a/Package.swift +++ b/Package.swift @@ -40,7 +40,7 @@ let package = Package( ] ), .package(url: "https://github.com/mattt/JSONSchema", from: "1.3.0"), - .package(url: "https://github.com/mattt/llama.swift", .upToNextMajor(from: "2.10549.0")), + .package(url: "https://github.com/mattt/llama.swift", .upToNextMajor(from: "3.0.0")), .package(url: "https://github.com/ml-explore/mlx-swift-lm", .upToNextMinor(from: "3.32.3")), .package(url: "https://github.com/swiftlang/swift-syntax", from: "602.0.0"), .package(url: "https://github.com/swift-server/async-http-client.git", from: "1.24.0"), diff --git a/README.md b/README.md index ab203758..92dd54c2 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ dependencies: [ > ), > .package(url: "https://github.com/huggingface/swift-transformers", from: "1.0.0"), // CoreML > .package(url: "https://github.com/ml-explore/mlx-swift-lm", .upToNextMinor(from: "3.32.3")), // MLX -> .package(url: "https://github.com/mattt/llama.swift", .upToNextMajor(from: "2.10549.0")), // Llama +> .package(url: "https://github.com/mattt/llama.swift", .upToNextMajor(from: "3.0.0")), // Llama > ] > ``` > diff --git a/Sources/AnyLanguageModel/Models/LlamaLanguageModel.swift b/Sources/AnyLanguageModel/Models/LlamaLanguageModel.swift index e34ee8eb..4735eb3f 100644 --- a/Sources/AnyLanguageModel/Models/LlamaLanguageModel.swift +++ b/Sources/AnyLanguageModel/Models/LlamaLanguageModel.swift @@ -2052,14 +2052,15 @@ import Foundation } } for imageData in images { - // Pinned to the current llama.swift signature. llama.cpp master adds a - // trailing options argument to this helper; update alongside the dependency. + // The options only configure video decoding, + // and video input is rejected below. let wrapper = imageData.withUnsafeBytes { raw -> mtmd_helper_bitmap_wrapper in mtmd_helper_bitmap_init_from_buf( mtmdContext, raw.bindMemory(to: UInt8.self).baseAddress, imageData.count, - false + false, + mtmd_helper_init_opt_default() ) } if let videoContext = wrapper.video_ctx {