google-deepmind / google-deepmind/gemma

Unable to Export LoRA Adapter in safetensors Format After Fine-tuning

Open
#254 5 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.