nguyenbh damajercakms commited on
Commit
1e10cf4
1 Parent(s): 38e202d

Update sample_finetune.py (#6)

Browse files

- Update sample_finetune.py (4dc71c4236ca50c6e77b3f6465159cda99009021)


Co-authored-by: David Majercak <damajercakms@users.noreply.huggingface.co>

Files changed (1) hide show
  1. sample_finetune.py +0 -3
sample_finetune.py CHANGED
@@ -151,9 +151,6 @@ def apply_chat_template(
151
  tokenizer,
152
  ):
153
  messages = example["messages"]
154
- # Add an empty system message if there is none
155
- if messages[0]["role"] != "system":
156
- messages.insert(0, {"role": "system", "content": ""})
157
  example["text"] = tokenizer.apply_chat_template(
158
  messages, tokenize=False, add_generation_prompt=False)
159
  return example
 
151
  tokenizer,
152
  ):
153
  messages = example["messages"]
 
 
 
154
  example["text"] = tokenizer.apply_chat_template(
155
  messages, tokenize=False, add_generation_prompt=False)
156
  return example