I want to SFT a multi-turn dataset using LLaMA 3 8B. An example data sample is in the following format:
[
{"role": "system", "content": "..."},
{"role": "user", "content": "..."},
{"role": "tool", "content": "..."},
{"role": "assistant", "content": "..."},
{"role": "user", "content": "..."},
{"role": "assistant", "content": "..."},
]
I am planning to use DataCollatorForCompletionOnlyLM for masking out content of roles that are not assistant. The documentation recommends to provide instruction and response templates for this task. However, it works when you have [INST] [/INST]
tags to distinguish when an instruction starts and ends, which is not the case in the above example (LLaMA makes use of <|start_header_id|>role<|end_header_id|>
). So, how do I use DataCollatorForCompletionOnlyLM
for masking out all roles except assistant in the above scenario?
Thank you!