# TRL Apply Chat Template Error

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftrl-apply-chat-template-error%2F105861%3E%5C
**Category:** Beginners\
**Created:** [September 8, 2024, 3:21pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftrl-apply-chat-template-error%2F105861 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fanniedoris)%5C
**Post date:** [September 8, 2024, 3:21pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftrl-apply-chat-template-error%2F105861%2F1 "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?
