nguyenbh damajercakms commited on
Commit
d27c49e
1 Parent(s): 9b3142d

Update sample_finetune.py (#3)

Browse files

- Update sample_finetune.py (4bb5056dbeccd999fdec592185294e6392d12969)


Co-authored-by: David Majercak <[email protected]>

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