Skip to content

Commit e9f0f0d

Browse files
committed
Clean up
1 parent e084bd1 commit e9f0f0d

File tree

6 files changed

+13
-16
lines changed

6 files changed

+13
-16
lines changed

Libraries/MLXLLM/LLMModelFactory.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,7 @@ public class LLMRegistry: AbstractModelRegistry, @unchecked Sendable {
128128
id: "mlx-community/Phi-3.5-MoE-instruct-4bit",
129129
defaultPrompt: "What is the gravity on Mars and the moon?",
130130
extraEOSTokens: ["<|end|>"]
131-
) {
132-
prompt in
133-
"<|user|>\n\(prompt)<|end|>\n<|assistant|>\n"
134-
}
131+
)
135132

136133
static public let gemma2bQuantized = ModelConfiguration(
137134
id: "mlx-community/quantized-gemma-2b-it",

Libraries/MLXLMCommon/ModelConfiguration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public struct ModelConfiguration: Sendable {
2424
}
2525
}
2626

27-
/// pull the tokenizer from an alternate id
27+
/// Alternate repo ID to use for the tokenizer
2828
public let tokenizerId: String?
2929

3030
/// A reasonable default prompt for the model
@@ -72,7 +72,7 @@ public struct ModelConfiguration: Sendable {
7272
public func modelDirectory(hub: HubApi = HubApi()) -> URL {
7373
switch id {
7474
case .id(let id, _):
75-
// download the model weights and config
75+
// Download the model weights and config
7676
let repo = Hub.Repo(id: id)
7777
return hub.localRepoLocation(repo)
7878

Libraries/MLXLMCommon/ModelFactory.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ public func loadModelContainer(
207207
}
208208
}
209209

210-
/// Load a model given a huggingface identifier.
210+
/// Load a model given a Hugging Face identifier.
211211
///
212-
/// This will load and return a ``ModelContext``. This holds the model and tokenzier without
212+
/// This will load and return a ``ModelContext``. This holds the model and tokenizer without
213213
/// an `actor` providing an isolation context. Use this call when you control the isolation context
214214
/// and can hold the ``ModelContext`` directly.
215215
///
216216
/// - Parameters:
217217
/// - hub: optional HubApi -- by default uses ``defaultHubApi``
218-
/// - id: huggingface model identifier, e.g "mlx-community/Qwen3-4B-4bit"
218+
/// - id: Hugging Face model identifier, e.g "mlx-community/Qwen3-4B-4bit"
219219
/// - progressHandler: optional callback for progress
220220
/// - Returns: a ``ModelContext``
221221
public func loadModel(
@@ -229,14 +229,14 @@ public func loadModel(
229229
}
230230
}
231231

232-
/// Load a model given a huggingface identifier.
232+
/// Load a model given a Hugging Face identifier.
233233
///
234234
/// This will load and return a ``ModelContainer``. This holds a ``ModelContext``
235235
/// inside an actor providing isolation control for the values.
236236
///
237237
/// - Parameters:
238238
/// - hub: optional HubApi -- by default uses ``defaultHubApi``
239-
/// - id: huggingface model identifier, e.g "mlx-community/Qwen3-4B-4bit"
239+
/// - id: Hugging Face model identifier, e.g "mlx-community/Qwen3-4B-4bit"
240240
/// - progressHandler: optional callback for progress
241241
/// - Returns: a ``ModelContainer``
242242
public func loadModelContainer(

Libraries/MLXVLM/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ media as needed. For example it might:
298298
- modify the prompt by injecting `<image>` tokens that the model expects
299299

300300
In the python implementations, much of this code typically lives in the `transformers`
301-
package from huggingface -- inspection will be required to determine which code
301+
package from Hugging Face -- inspection will be required to determine which code
302302
is called and what it does. You can examine the processors in the `Models` directory:
303303
they reference the files and functions that they are based on.
304304

skills/mlx-swift-lm/references/embeddings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ print("Similarity: \(similarity)") // ~0.85
248248
```swift
249249
public struct ModelConfiguration: Sendable {
250250
public enum Identifier: Sendable {
251-
case id(String) // HuggingFace ID
251+
case id(String) // Hugging Face ID
252252
case directory(URL) // Local path
253253
}
254254

skills/mlx-swift-lm/references/model-container.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Overview
44

5-
`ModelContainer` is the thread-safe wrapper for language models, providing exclusive access to model resources during inference. `ModelConfiguration` describes model identity and settings. Factory classes handle model instantiation from HuggingFace or local directories.
5+
`ModelContainer` is the thread-safe wrapper for language models, providing exclusive access to model resources during inference. `ModelConfiguration` describes model identity and settings. Factory classes handle model instantiation from Hugging Face or local directories.
66

77
## Quick Reference
88

@@ -124,7 +124,7 @@ for await event in stream {
124124
### Creating Configurations
125125

126126
```swift
127-
// From HuggingFace model ID
127+
// From Hugging Face model ID
128128
let config = ModelConfiguration(
129129
id: "mlx-community/Llama-3.2-3B-Instruct-4bit",
130130
defaultPrompt: "Hello",
@@ -227,7 +227,7 @@ Map `model_type` from config.json to model initializers:
227227

228228
## Loading Flow
229229

230-
1. **Download**: Model weights fetched from HuggingFace (cached locally)
230+
1. **Download**: Model weights fetched from Hugging Face (cached locally)
231231
2. **Parse config.json**: Determine `model_type` and configuration
232232
3. **Create model**: TypeRegistry maps type to initializer
233233
4. **Load weights**: `.safetensors` files loaded into model

0 commit comments

Comments
 (0)