Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
> ]
> ```
>
Expand Down
7 changes: 4 additions & 3 deletions Sources/AnyLanguageModel/Models/LlamaLanguageModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading