Run this model with HF Jobs

Run google/gemma-1.1-7b-it on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/google/gemma-1.1-7b-it. Ask me which dataset to train on, then push the fine-tuned model to a new private model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/google/gemma-1.1-7b-it on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/google/gemma-1.1-7b-it. Ask me which benchmark to run, then save the scores and the per-example results to a new private dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/google/gemma-1.1-7b-it. Push it to a new private model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Do I need to apply_chat_template before Supervised Fine-tuning Gemma-1.1-7b-it?

#19
by Syax19 - opened

I'm a novice in training LLM for the first time and would greatly appreciate any assistance.

I noticed that in the "example_sft_qlora.py" script, there's a formatting function defined as:

def formatting_func(example):
    text = f"### USER: {example['data'][0]}\n### ASSISTANT: {example['data'][1]}"
    return text

I don't see any mention of applying apply_chat_template as using Gemma-1.1-7b-it model for inference.
Is it because supervised fine-tuning doesn't require using the original template?
Will my custom template which is like in the formatting_func overwrite original template during training, or do I need to modify the formatting_func to apply the original chat_template?

Looking forward for replying.
Thanks!

Hi @Syax19 , Supervised Fine tuning doesn't utilize the original chat template during inference. Hence, the custom template in formatting_func will not overwrite the original template. You can use your custom template for training without the need to modify formatting_func. If you want to apply the original chat template, you would need to modify the formatting_func to include the template. Alternatively, you can use the apply_chat_template utility provided by Gemma-1.1-7b-it to apply the template during inference.

Thanks for your help!

Sign up or log in to comment