cppowboy commited on
Commit
a9d3817
1 Parent(s): 508a16b

Update tokenization_minicpm.py

Browse files
Files changed (1) hide show
  1. tokenization_minicpm.py +1 -1
tokenization_minicpm.py CHANGED
@@ -366,7 +366,7 @@ func2(params)
366
  tools_string = ""
367
 
368
  if add_to_system:
369
- if len(messages) > 0 and messages[0]["role"] != "system":
370
  messages.insert(0, {"role": "system", "content": ""})
371
  return [message_format(msg, system_suffix=tools_string, user_prefix="") for msg in messages]
372
  else:
 
366
  tools_string = ""
367
 
368
  if add_to_system:
369
+ if len(messages) > 0 and messages[0]["role"] != "system" and tools_string != "":
370
  messages.insert(0, {"role": "system", "content": ""})
371
  return [message_format(msg, system_suffix=tools_string, user_prefix="") for msg in messages]
372
  else: