# TRL Apply Chat Template Error

**URL:** <https://discuss.huggingface.co/t/trl-apply-chat-template-error/105861>\
**Category:** Beginners\
**Created:** [September 8, 2024, 3:21pm UTC](https://discuss.huggingface.co/t/trl-apply-chat-template-error/105861 "2024-09-08T15:21:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anniedoris](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@anniedoris](https://discuss.huggingface.co/u/anniedoris)\
**Post date:** [September 8, 2024, 3:21pm UTC](https://discuss.huggingface.co/t/trl-apply-chat-template-error/105861/1 "2024-09-08T15:21:59Z")

</div>

I’m new to TRL CLI. I’m trying to follow [this example](https://huggingface.co/blog/llama3#fine-tuning-with-%F0%9F%A4%97-trl) for fine tuning, and I’m running into the following error:

```auto
ValueError: Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed!

```

How can I set a chat template during fine tuning?
