ml-explore / ml-explore/mlx-examples
Inferencing with adapter vs Inferencing with fused model
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Hi everyone,
First of all let me say a big "THANK YOU" for your work !
I have successfully fine tuned phi-2. However I noticed the following:
- Inferencing with the fused model usually gives bad results. I use this code
python -m mlx_lm.generate --model <fused-model-path> --prompt "hello". I don't see any effect of the fine tuning and sometimes it gives me nonsense. - However when I use the following code, the results are much much better and I can see the fine tuning:
python lora.py --model mlx_model --adapter-file adapters.npz --max-tokens 300 --prompt "<your-prompt-here>"
So I was wondering if someone can help me understand/explain this. My goal is to be able to use the model in a web app.
Thanks a lot !
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 comparing the inference paths in mlx_lm.generate and lora.py, using the fused-model and adapter-file commands shown in the report. Reproduce the difference and trace where the fused model and adapter are loaded; done means documenting the cause and confirming the expected behavior for web-app inference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100