Open Butanium opened 2 days ago
Also @yonigottesman, assistant_mask in not converted ot a tensor even if I do
tokens = tokenizer.apply_chat_template(
chat,
tokenize=True,
return_assistant_tokens_mask=True,
return_dict=True,
chat_template=better_template,
return_tensors ="pt"
)
@Butanium you are right there is a bug in my code, I will fix and update.
BTW, you should include the {{ '<end_of_turn>\n' }}
insude the generation block, as you want the model to learn to output this string when its done
thank you! I edited my template to include the <end_of_turn>
but not the \n
as those are different tokens
System Info
transformers
version: 4.45.2Who can help?
@yonigottesman
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
I modified gemma template to allow
assitant_masks
to work:however, if a model message gets truncated, the mask is all 0:
Expected behavior
I'd expect the mask to have 1 on the partial model response