huggingface / alignment-handbook

Robust recipes to align language models with human and AI preferences
https://huggingface.co/HuggingFaceH4
Apache License 2.0
4.28k stars 367 forks source link

Fix `apply_chat_template` function for `dpo` and unknown `task` #30

Closed alvarobartt closed 8 months ago

alvarobartt commented 8 months ago

Hi to whoever is reading this! 🤗

Description

This PR solves an issue with the error message when the task in alignment.data.apply_chat_template was not being recognised as it was incorrect, and also moved some lines under the dpo task.

Besides that, also some duplicated # coding=utf-8 lines have been removed.