Skip to content

Commit baee551

Browse files
committed
Update to mlx-swift-lm
1 parent 761cea7 commit baee551

File tree

3 files changed

+26
-37
lines changed

3 files changed

+26
-37
lines changed

Package.resolved

Lines changed: 18 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
import PackageDescription
55

66
let package = Package(
7-
name: "MLXStructured",
7+
name: "mlx-swift-structured",
88
platforms: [.macOS(.v14), .iOS(.v16)],
9-
products: [
10-
.library(name: "MLXStructured", targets: ["MLXStructured"]),
11-
],
9+
products: [.library(name: "MLXStructured", targets: ["MLXStructured"])],
1210
dependencies: [
1311
.package(url: "https://github.com/ml-explore/mlx-swift", from: "0.25.6"),
14-
.package(url: "https://github.com/ml-explore/mlx-swift-examples", from: "2.25.7"),
15-
.package(url: "https://github.com/huggingface/swift-transformers", from: "0.1.24"),
12+
.package(url: "https://github.com/ml-explore/mlx-swift-lm", from: "2.29.2"),
13+
.package(url: "https://github.com/huggingface/swift-transformers", from: "1.1.0"),
1614
.package(url: "https://github.com/petrukha-ivan/swift-json-schema", from: "2.0.2"),
1715
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.4.0"),
1816
],
@@ -46,7 +44,7 @@ let package = Package(
4644
dependencies: [
4745
.target(name: "CMLXStructured"),
4846
.product(name: "MLX", package: "mlx-swift"),
49-
.product(name: "MLXLMCommon", package: "mlx-swift-examples"),
47+
.product(name: "MLXLMCommon", package: "mlx-swift-lm"),
5048
.product(name: "JSONSchema", package: "swift-json-schema")
5149
]
5250
),
@@ -55,7 +53,7 @@ let package = Package(
5553
name: "MLXStructuredCLI",
5654
dependencies: [
5755
.target(name: "MLXStructured"),
58-
.product(name: "MLXLLM", package: "mlx-swift-examples"),
56+
.product(name: "MLXLLM", package: "mlx-swift-lm"),
5957
.product(name: "ArgumentParser", package: "swift-argument-parser"),
6058
],
6159
),
@@ -64,7 +62,7 @@ let package = Package(
6462
name: "MLXStructuredTests",
6563
dependencies: [
6664
.target(name: "MLXStructured"),
67-
.product(name: "MLXLLM", package: "mlx-swift-examples"),
65+
.product(name: "MLXLLM", package: "mlx-swift-lm"),
6866
],
6967
),
7068
],

Sources/MLXStructured/GrammarMatcherFactory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public extension GrammarMaskedLogitProcessor {
2727
configurations.tokenizerData
2828
)
2929

30-
let vocabSize = modelConfig.vocabSize.integer(or: 0)
30+
let vocabSize = modelConfig?.vocabSize.integer() ?? 0
3131
var vocab = Array(repeating: "", count: vocabSize)
3232

3333
for (key, value) in tokenizerData.model.vocab.dictionary(or: [:]) {

0 commit comments

Comments
 (0)