nguyenbh damajercakms commited on
Commit
bbd531d
1 Parent(s): 30e8c65

Update sample_finetune.py (#69)

Browse files

- Update sample_finetune.py (a9fe59ff7e4587cd385fb5c04166d3e03f29d501)


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