chat template: tool call fix?

#16
by sbrandeis HF Staff - opened

TL;DR

The role displayed for a tool call is user - I assume that is a mistake and the chat template should use the provided role instead (tool)

This PR is untested, feel free to disregard if not relevant

Hugging Face Smol Models Research org
Hugging Face Smol Models Research org
edited 11 days ago

This is a good point, and was a conversation we had while designing the chat template.

Leaving the tool call as user was a design choice we made during the SFT phase of training to mask the loss for the tool role. Our SFT pipeline already masked the loss for the user role, so mapping the tool call to the user role enables masking the loss through the chat template.

This mapping had a limited impact on BFCL scores, so we decided to continue with that approach.

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment