# LLM fine-tuning base model adaptation

**URL:** <https://discuss.flower.ai/t/llm-fine-tuning-base-model-adaptation/414>\
**Category:** General\
**Created:** [November 14, 2024, 8:23am UTC](https://discuss.flower.ai/t/llm-fine-tuning-base-model-adaptation/414 "2024-11-14T08:23:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alanflower](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@alanflower](https://discuss.flower.ai/u/alanflower)\
**Post date:** [November 14, 2024, 8:23am UTC](https://discuss.flower.ai/t/llm-fine-tuning-base-model-adaptation/414/1 "2024-11-14T08:23:12Z")

</div>

Hi！  
The official [LLM fine-tune example](https://github.com/adap/flower/tree/main/examples/flowertune-llm)) is based on LLaMA2 and uses the alpaca template.  
Do I need to redefine the get\_tokenizer\_and\_data\_collator\_and\_propt\_formatting function in dataset.py if I want to use other base models?

---

<div class="post-metadata">

**Author:** ![kareem](https://dub1.discourse-cdn.com/flex013/user_avatar/discuss.flower.ai/kareem/32/129_2.png) [@kareem](https://discuss.flower.ai/u/kareem)\
**Post date:** [November 14, 2024, 11:28pm UTC](https://discuss.flower.ai/t/llm-fine-tuning-base-model-adaptation/414/2 "2024-11-14T23:28:44Z")

</div>

I think you need to update the following  
response\_template\_with\_context = “\n### Response:” # alpaca response tag

and pyproject.toml and specify the dataset name and huggingface will do the other work for you!

---

<div class="post-metadata">

**Author:** ![alanflower](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@alanflower](https://discuss.flower.ai/u/alanflower)\
**Post date:** [November 15, 2024, 5:06am UTC](https://discuss.flower.ai/t/llm-fine-tuning-base-model-adaptation/414/3 "2024-11-15T05:06:43Z")

</div>

Thanks for your reply, I noticed that the chat\_template of different models is different, what should I refer to to modify the template in the code? Meanwhile, the example is single-round , if I want to implement multiple rounds of dialogue, is the code logic contradictory?
