matthieumeeus97 commited on
Commit
c3ee1fe
1 Parent(s): f8245fb

adding chat template

Browse files
Files changed (1) hide show
  1. tokenizer_config.json +2 -1
tokenizer_config.json CHANGED
@@ -28,6 +28,7 @@
28
  }
29
  },
30
  "bos_token": "<s>",
 
31
  "clean_up_tokenization_spaces": false,
32
  "eos_token": "</s>",
33
  "legacy": false,
@@ -38,4 +39,4 @@
38
  "tokenizer_class": "LlamaTokenizer",
39
  "unk_token": "<unk>",
40
  "use_default_system_prompt": false
41
- }
 
28
  }
29
  },
30
  "bos_token": "<s>",
31
+ "chat_template": "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|user|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'system' %}\n{{ '<|system|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'assistant' %}\n{{ '<|assistant|>\n' + message['content'] + eos_token }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '<|assistant|>' }}\n{% endif %}\n{% endfor %}",
32
  "clean_up_tokenization_spaces": false,
33
  "eos_token": "</s>",
34
  "legacy": false,
 
39
  "tokenizer_class": "LlamaTokenizer",
40
  "unk_token": "<unk>",
41
  "use_default_system_prompt": false
42
+ }