google / gemma_pytorch

The official PyTorch implementation of Google's Gemma models
https://ai.google.dev/gemma
Apache License 2.0
5.16k stars 490 forks source link

how to finetune with gemma model? #8

Open runningabcd opened 4 months ago

runningabcd commented 4 months ago

how to finetune with gemma model?

runningabcd commented 4 months ago

I had download gemma-7b-it model from hugging face already, but not find the script that can finetune wiht my own data

runningabcd commented 4 months ago

help

runningabcd commented 4 months ago

I had download gemma-7b-it model from hugging face already, but not find the script that can finetune wiht my own data

How to sft with gemma?Can you tell me the sft data format?

runningabcd commented 4 months ago

I had download gemma-7b-it model from hugging face already, but not find the script that can finetune wiht my own data

How to sft with gemma?Can you tell me the sft data format?

@pengchongjin

pengchongjin commented 4 months ago

Hi there, unfortunately, this repo doesn't provide finetuning features.

Here are a few alternatives that might fit your needs:

  1. On Gemma model card in Vertex Model Garden, there are a few notebooks which demonstrate how to do finetuning and then deploy to Vertex endpoints.
  2. On Gemma model card in Kaggle, there are a few notebooks which uses KerasNLP to do finetuning.
  3. HuggingFace demonstrates how to use TRL to do finetuning in this blog post.

Hope it helps.

r-gheda commented 4 months ago

@pengchongjin Is it possible to implement a class for fine tuning the model inside this repo similar to what done with llama-recipes?

aliasneo1 commented 3 months ago

Are there any tutorials for fine-tuning 7b-it-quant model ?

selamw1 commented 2 months ago

Hi @aliasneo1

There are a few tutorials that demonstrate fine-tuning the gemma-2b model. You can follow similar procedures to fine-tune the Gemma variant gemma-7b-it.

Here are some resources: