Skip to content

Commit 0c65930

Browse files
authored
fix various warnings -- deprecations (#265)
1 parent 289bb67 commit 0c65930

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

Applications/LoRATrainingExample/ContentView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class LoRAEvaluator {
123123

124124
var output = ""
125125

126-
private let modelConfiguration = ModelRegistry.mistral7B4bit
126+
private let modelConfiguration = LLMRegistry.mistral7B4bit
127127
private var model: ModelState = .idle
128128

129129
private let loraLayers = 4

Applications/VLMEval/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The example application uses Qwen-VL-2B model by default, see [ContentView.swift
1919

2020
```swift
2121
self.modelContainer = try await VLMModelFactory.shared.loadContainer(
22-
configuration: ModelRegistry.qwen2VL2BInstruct4Bit)
22+
configuration: VLMRegistry.qwen2VL2BInstruct4Bit)
2323
```
2424

2525
The application:

Libraries/MLXLLM/Documentation.docc/using-model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A model is typically loaded by using a `ModelFactory` and a `ModelConfiguration`
1010
// e.g. LLMModelFactory.shared
1111
let modelFactory: ModelFactory
1212

13-
// e.g. MLXLLM.ModelRegistry.llama3_8B_4bit
13+
// e.g. LLMRegistry.llama3_8B_4bit
1414
let modelConfiguration: ModelConfiguration
1515

1616
let container = try await modelFactory.loadContainer(configuration: modelConfiguration)

Libraries/MLXLLM/LLMModelFactory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ private struct LLMUserInputProcessor: UserInputProcessor {
231231
///
232232
/// ```swift
233233
/// let modelContainer = try await LLMModelFactory.shared.loadContainer(
234-
/// configuration: ModelRegistry.llama3_8B_4bit)
234+
/// configuration: LLMRegistry.llama3_8B_4bit)
235235
/// ```
236236
public class LLMModelFactory: ModelFactory {
237237

Libraries/MLXLMCommon/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A model is typically loaded by using a `ModelFactory` and a `ModelConfiguration`
1616
// e.g. VLMModelFactory.shared
1717
let modelFactory: ModelFactory
1818

19-
// e.g. MLXVLM.ModelRegistry.paligemma3bMix4488bit
19+
// e.g. VLMRegistry.paligemma3bMix4488bit
2020
let modelConfiguration: ModelConfiguration
2121

2222
let container = try await modelFactory.loadContainer(configuration: modelConfiguration)

Libraries/MLXVLM/VLMModelFactory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public typealias ModelRegistry = VLMRegistry
159159
///
160160
/// ```swift
161161
/// let modelContainer = try await VLMModelFactory.shared.loadContainer(
162-
/// configuration: ModelRegistry.paligemma3bMix4488bit)
162+
/// configuration: VLMRegistry.paligemma3bMix4488bit)
163163
/// ```
164164
public class VLMModelFactory: ModelFactory {
165165

Tools/llm-tool/LLMTool.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ struct EvaluateCommand: AsyncParsableCommand {
285285
let vlm = !image.isEmpty || !video.isEmpty
286286
if vlm {
287287
modelFactory = VLMModelFactory.shared
288-
defaultModel = MLXVLM.ModelRegistry.qwen2VL2BInstruct4Bit
288+
defaultModel = MLXVLM.VLMRegistry.qwen2VL2BInstruct4Bit
289289
} else {
290290
modelFactory = LLMModelFactory.shared
291-
defaultModel = MLXLLM.ModelRegistry.mistral7B4bit
291+
defaultModel = MLXLLM.LLMRegistry.mistral7B4bit
292292
}
293293

294294
// Load the model

Tools/llm-tool/LoraCommands.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct LoRACommand: AsyncParsableCommand {
2222
)
2323
}
2424

25-
private let defaultModel = MLXLLM.ModelRegistry.mistral7B4bit.name
25+
private let defaultModel = MLXLLM.LLMRegistry.mistral7B4bit.name
2626

2727
/// Common arguments for loading a LoRA mdoel with adapter weights
2828
struct LoRAModelArguments: ParsableArguments, Sendable {
@@ -210,7 +210,7 @@ struct LoRAFuseCommand: AsyncParsableCommand {
210210
let inputURL = await modelContainer.configuration.modelDirectory()
211211
let enumerator = FileManager.default.enumerator(
212212
at: inputURL, includingPropertiesForKeys: nil)!
213-
for case let url as URL in enumerator {
213+
for url in enumerator.allObjects.compactMap({ $0 as? URL }) {
214214
// copy everything except the model weights -- we will write out the fused one below
215215
if url.pathExtension == "safetensors" {
216216
continue

0 commit comments

Comments
 (0)