Skip to content

Commit 8a1730e

Browse files
authored
Porting doc edits (#271)
* remove super.init() not present in Gemma.swift * important -> note The Swift Package Index does not appear to render "important" documentation blocks.
1 parent efb9ed7 commit 8a1730e

File tree

1 file changed

+3
-4
lines changed
  • Libraries/MLXLMCommon/Documentation.docc

1 file changed

+3
-4
lines changed

Libraries/MLXLMCommon/Documentation.docc/porting.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ private class RMSNorm: Module, UnaryLayer {
148148
public init(dimensions: Int, eps: Float = 1e-5) {
149149
self.weight = MLXArray.ones([dimensions])
150150
self.eps = eps
151-
super.init()
152151
}
153152

154153
public func callAsFunction(_ x: MLXArray) -> MLXArray {
@@ -188,7 +187,7 @@ parameters to the initializer. In typical inference use these values
188187
will be replaced when the weights are loaded
189188
(``loadWeights(modelDirectory:model:quantization:)``).
190189

191-
* Important:
190+
* Note:
192191
If the property names in Python don't make good Swift names you can use the `@ParameterInfo` property wrapper to specify the key:\
193192
\
194193
`@ParameterInfo(key: "some_weight") var weight: MLXArray`
@@ -217,7 +216,7 @@ public func callAsFunction(_ x: MLXArray) -> MLXArray {
217216
}
218217
```
219218

220-
* Important:
219+
* Note:
221220
[This reference](https://swiftpackageindex.com/ml-explore/mlx-swift/main/documentation/mlx/converting-python) shows the mapping between Python method and function names and Swift.
222221

223222
### Porting Layers -- Children
@@ -318,7 +317,7 @@ If there are many properties that _are_ needed, it may be more
318317
convenient in Swift to simply store the `GemmaConfiguration` --
319318
that provides access to the typed properties inside.
320319

321-
* Important:
320+
* Note:
322321
Much like parameters with non-Swift names, you can (and typically do) use `@ModuleInfo` to give the same naming hint:\
323322
\
324323
`@ModuleInfo(key: "self_attn") var attention: Attention`

0 commit comments

Comments
 (0)