unslothai / unsloth

Finetune Llama 3.2, Mistral, Phi, Qwen 2.5 & Gemma LLMs 2-5x faster with 80% less memory
https://unsloth.ai
Apache License 2.0
18.4k stars 1.29k forks source link

fix/get_chat_template #1246

Closed Erland366 closed 1 week ago

Erland366 commented 2 weeks ago

989 fixes this

So now every chat template that HAS DEFAULT SYSTEM PROMPT, we will be able to get modified by using the arguments in get_chat_template. Evaluation is attached in DM.

Also fixes gemma template bug where it supposed to be messages instead of loop_messages

If user pass custom chat template. It'll

  1. if pass system_message with the placeholder in the chat template -> {system_message}. It'll work
  2. but if not pass system_message, then it'll error
danielhanchen commented 1 week ago

Looks great!