Skip to content

Conversation

DePasqualeOrg
Copy link
Contributor

Please revise this if necessary. I generated the section on property wrappers based on the existing models in this repo.

@xlab
Copy link
Contributor

xlab commented Jul 2, 2025

I recommend adding a tricky case #340 (comment)
when a param doesn't exist during load, and must be computed. You want to differentiate a field for that, and that must not be confused with self._field.wrappedValue.

Example:

 @ParameterInfo(key: "correct_output_scale") var correctOutputScale: MLXArray
  private let _routerInputScale: MLXArray

// yes:
self._correctOutputScale.wrappedValue = MLXArray(...

// but:
self._routerInputScale = MLXArray(...

Copy link
Collaborator

@davidkoski davidkoski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

@davidkoski davidkoski merged commit 42b0d21 into ml-explore:main Jul 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants