How to finetune this model mistralai/Mistral-7B-v0.1 and also merge the weights
I want to Finetune this model and also merge the weights
Hi
@yeniceriSGK
You can use many tools to fine-tune this model today, from the tools I know you could use:
- TRL: https://github.com/huggingface/trl / a starting point could be: https://github.com/huggingface/trl/blob/main/examples/scripts/sft.py
- axolotl: https://github.com/OpenAccess-AI-Collective/axolotl from @winglian
- llama-factory: https://github.com/hiyouga/LLaMA-Factory - from @hiyouga
- unsloth: https://github.com/unslothai/unsloth from @danielhanchen
@yeniceriSGK If you need help on Unsloth, more than happy to help :) Llama-Factory also has an unsloth integration, so if you're into a UI for finetuning, then go for that!
Unsloth supports direct merging to 16bit or GGUF after you finetune - I have a Mistral notebook which finetunes Mistral and even allows inference, saving, merging etc. https://colab.research.google.com/drive/1Dyauq4kTZoLewQ1cApceUQVNcnnNTzg_?usp=sharing
And Unsloth finetunes 2.2x faster and saves 70% VRAM and is fully free + works on Tesla T4s, RTX 2080s and all newer GPUs :)
Hello! You can use JumpStart from AWS to speed up the finetune process. However, I'm not sure I understand when you ask for the weights. Could you please clarify?
@dpalacio I also have the same issue as @yeniceriSGK How to load the base model and attach the adapter using PeftModel, run the inference, merge the model weights.
hi
@Maaz911
,
you can use LLaMA-Factory for model inference and merging the lora weights, please visit the readme file for usage