Example of finetuning with QLoRA/QDoRA?

#2
by asmith26 - opened

Hi there,

I'm trying to finetune this on a 16GB Colab GPU - just wondering if there are any examples of doing this (preferably with the Jax backend + QDoRA for performance)?

Thanks for any help! :)

Google org

The closest example I found is this tutorial, which demonstrates fine-tuning Gemma with LoRA/QLoRA using the JAX backend. You can follow a similar procedure to fine-tune PaliGemma with QDoRA.
Be sure to adjust the dataset and other relevant parameters to match your specific use case.

To load this specific PaliGemma model, use the following code:

preprocessor = keras_nlp.models.PaliGemmaCausalLMPreprocessor.from_preset(
    "hf://google/paligemma-3b-224-mix-keras", sequence_length=256
)
paligemma_lm = keras_nlp.models.PaliGemmaCausalLM.from_preset(
    "hf://google/paligemma-3b-224-mix-keras", preprocessor=preprocessor
)

Sign up or log in to comment