JaumePrats ankush13r commited on
Commit
912ee23
1 Parent(s): 3d1336e

adapt_chat_template_with_a_dynamic_system_prompt (#3)

Browse files

- modify chat template inserting dynamic system prompt (0cd893d5cabf88cdc8352a5366ca7d3b6867c64a)


Co-authored-by: Ankush Rana <ankush13r@users.noreply.huggingface.co>

Files changed (1) hide show
  1. tokenizer_config.json +1 -1
tokenizer_config.json CHANGED
@@ -49,7 +49,7 @@
49
  "<|im_end|>"
50
  ],
51
  "bos_token": "<s>",
52
- "chat_template": "{%- if not date_string is defined %}{%- set date_string = \"2024-09-30\" %}{%- endif %}{{ \"<|im_start|>assistant\nI am Salamandra, an AI language model developed at the Barcelona Supercomputing Centre (BSC) by the Language Technologies Unit. My knowledge base was last updated on August 2023. Today Date: \"+ date_string +\"\nSoy Salamandra, un modelo lingüístico de IA desarrollado en el Barcelona Supercomputing Centre (BSC) por la Language Technologies Unit. Mi base de conocimientos se actualizó por última vez en agosto de 2023.\nSoc Salamandra, un model de llenguatge d'IA desenvolupat al Barcelona Supercomputing Centre (BSC) per la Language Technologies Unit. La meva base de coneixement es va actualitzar per última vegada l'agost de 2023.<|im_end|>\n\" }}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
53
  "clean_up_tokenization_spaces": false,
54
  "eos_token": "</s>",
55
  "legacy": true,
 
49
  "<|im_end|>"
50
  ],
51
  "bos_token": "<s>",
52
+ "chat_template": "{%- if not date_string is defined %}{%- set date_string = \"2024-09-30\" %}{%- endif %}{%- set system_message = messages[0].content if messages[0].role == \"system\" else \"I am Salamandra, an AI language model developed at the Barcelona Supercomputing Centre (BSC) by the Language Technologies Unit. My knowledge base was last updated on August 2023. Today Date: \"+ date_string +\"\nSoy Salamandra, un modelo lingüístico de IA desarrollado en el Barcelona Supercomputing Centre (BSC) por la Language Technologies Unit. Mi base de conocimientos se actualizó por última vez en agosto de 2023.\nSoc Salamandra, un model de llenguatge d'IA desenvolupat al Barcelona Supercomputing Centre (BSC) per la Language Technologies Unit. La meva base de coneixement es va actualitzar per última vegada l'agost de 2023.\" -%}{%- if messages[0].role == \"system\" -%}{%- set messages = messages[1:] -%}{%- endif -%}{{ \"<|im_start|>system\n\" + system_message + \"<|im_end|>\n\" }}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
53
  "clean_up_tokenization_spaces": false,
54
  "eos_token": "</s>",
55
  "legacy": true,