ml-explore / ml-explore/mlx-examples
[Feature Request] Unable to Unload or Swap adapters at runtime
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Currently, adapters can be loaded with:
model.load_weights('/path/to/weights', strict=False)
However, there is no way to either unload the weights:
model.unload_weights()
or to swap in a new one dynamically:
model.swap_weights('/path/to/other/weights')
This is useful for several use cases, including DPO loss calculation & Dynamically serving LoRA Adapters
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing model.load_weights('/path/to/weights', strict=False) entry point and how loaded adapters are tracked. Define how unload_weights() and swap_weights('/path/to/other/weights') should behave at runtime, including the DPO and dynamic-serving use cases linked in the issue. Done means both operations work without rebuilding the model and are covered by appropriate tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100