google-deepmind / google-deepmind/gemma
Unable to Export LoRA Adapter in safetensors Format After Fine-tuning
- Dominant language
- Python
- Stars
- 5.7k
- Forks
- 1k
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 2
Description
I followed the [LoRA Fine-tuning guide](https://gemma-llm.readthedocs.io/en/latest/colab_lora_finetuning.html) to fine-tune a Gemma3-4B model using LoRA. After the fine-tuning completed, I attempted to save the LoRA adapter using the following code:
```python
original, lora = peft.split_params(state.params)
gm.ckpts.save_params(lora, "/content/gemma3-lora")
```
However, this does not seem to save the adapter in the `safetensors` format. I need to export the LoRA adapter in `safetensors` format so that I can run the adapter with vLLM.
Could anyone provide guidance on how to properly save the LoRA adapter in `safetensors` format?
Thank you!
Contributor guide
Assessment
This issue has not been assessed yet.