Lightning-AI / Lightning-AI/litgpt

After Fintune lora. apply chat_template

Open
#1,986 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted question
Dominant language
Python
Stars
13.7k
Forks
1.5k
Avg merge
15h 37m
Merged PRs (30d)
1

Description

Hi. I appreciate your great work.

I fintuned ```llama-3.2-1B``` base model using my custom data
```shell
litgpt finetune_lora "meta-llama/Llama-3.2-1B" \
--data JSON \
--data.json_path /data/donggukang/litgpt/OpenMathInstruct-2-1K_litgpt_format.json \
--data.val_split_fraction 0.1
```
The base model repository doesn't have a ```chat_template``` defined in its [```tokenizer_config.json``` ](https://huggingface.co/meta-llama/Llama-3.2-1B/blob/main/tokenizer_config.json)

However, during LoRA fine-tuning, I applied Alpaca template(as a default)

After the LoRA fine-tuning was completed, the ```prompt_style.yaml``` file contains the chat template(called in prompt_style), but the tokenizer_config.json still has the same configuration as the base model (i.e., without a chat_template).

Will this cause any issues when loading HF-converted model?
(I think tokenizer_config.json's chat_template must be edited by trained prompt_style..)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the HF conversion and model-loading path, then compare the prompt_style.yaml chat template with tokenizer_config.json for the fine-tuned model. Determine whether conversion preserves the applied template and identify what behavior or documentation is needed when the base tokenizer has no chat_template.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.