helenai commited on
Commit
851c41b
·
verified ·
1 Parent(s): 610ffa8

Upload folder using huggingface_hub

Browse files
openvino_detokenizer.xml CHANGED
@@ -246,7 +246,7 @@
246
  <add_prefix_space />
247
  <add_special_tokens value="True" />
248
  <bos_token_id value="0" />
249
- <chat_template value="{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = '### Instruction: ' + messages[0]['content'] + '&#10;Complete the conversation below between [|Human|] and [|AI|]:&#10;### Input:'%}{% else %}{% set loop_messages = messages %}{% set system_message = '### Instruction: Your name is \'Jais\', and you are named after Jebel Jais, the highest mountain in UAE. You were made by \'Inception\' in the UAE. You are a helpful, respectful, and honest assistant. Always answer as helpfully as possible, while being safe. Complete the conversation below between [|Human|] and [|AI|]:&#10;### Input:' %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = system_message %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{% if loop.index0 == 0 %}{{ content + ' [|Human|] ' + message['content'] }}{% else %}{{ '&#10;[|Human|] ' + content.strip() }}{% endif %}{% elif message['role'] == 'assistant' %}{{ '&#10;[|AI|] ' + content.strip() }}{% endif %}{% endfor %}{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %} {{'&#10;[|AI|]&#10;### Response:'}}{% endif %}" />
250
  <clean_up_tokenization_spaces />
251
  <detokenizer_input_type value="i64" />
252
  <eos_token_id value="0" />
 
246
  <add_prefix_space />
247
  <add_special_tokens value="True" />
248
  <bos_token_id value="0" />
249
+ <chat_template value="{% set system_message = '' %}{% set loop_start = 0 %}{% if messages[0]['role'] == 'system' %}{% set loop_start = 1 %}{% set system_message = '### Instruction: ' ~ messages[0]['content'] ~ '\nComplete the conversation below between [|Human|] and [|AI|]:\n### Input:' %}{% else %}{% set system_message = '### Instruction: Your name is Jais, and you are named after Jebel Jais, the highest mountain in UAE. You were made by Inception in the UAE. You are a helpful, respectful, and honest assistant. Always answer as helpfully as possible, while being safe. Complete the conversation below between [|Human|] and [|AI|]:\n### Input:' %}{% endif %}{% for i in range(loop_start, messages | length) %}{% set message = messages[i] %}{% if i == loop_start %}{% set content = system_message %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{% if i == loop_start %}{{ content ~ ' [|Human|] ' ~ message['content'] }}{% else %}{{ '\n[|Human|] ' ~ content | trim }}{% endif %}{% elif message['role'] == 'assistant' %}{{ '\n[|AI|] ' ~ content | trim }}{% endif %}{% endfor %}{% if add_generation_prompt and messages[messages | length - 1]['role'] != 'assistant' %}{{ '\n[|AI|]\n### Response:' }}{% endif %}" />
250
  <clean_up_tokenization_spaces />
251
  <detokenizer_input_type value="i64" />
252
  <eos_token_id value="0" />
openvino_tokenizer.xml CHANGED
@@ -612,7 +612,8 @@
612
  <add_prefix_space />
613
  <add_special_tokens value="True" />
614
  <bos_token_id value="0" />
615
- <chat_template value="{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = '### Instruction: ' + messages[0]['content'] + '&#10;Complete the conversation below between [|Human|] and [|AI|]:&#10;### Input:'%}{% else %}{% set loop_messages = messages %}{% set system_message = '### Instruction: Your name is \'Jais\', and you are named after Jebel Jais, the highest mountain in UAE. You were made by \'Inception\' in the UAE. You are a helpful, respectful, and honest assistant. Always answer as helpfully as possible, while being safe. Complete the conversation below between [|Human|] and [|AI|]:&#10;### Input:' %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = system_message %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{% if loop.index0 == 0 %}{{ content + ' [|Human|] ' + message['content'] }}{% else %}{{ '&#10;[|Human|] ' + content.strip() }}{% endif %}{% elif message['role'] == 'assistant' %}{{ '&#10;[|AI|] ' + content.strip() }}{% endif %}{% endfor %}{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %} {{'&#10;[|AI|]&#10;### Response:'}}{% endif %}" />
 
616
  <clean_up_tokenization_spaces />
617
  <detokenizer_input_type value="i64" />
618
  <eos_token_id value="0" />
 
612
  <add_prefix_space />
613
  <add_special_tokens value="True" />
614
  <bos_token_id value="0" />
615
+ <chat_template value="{% set system_message='' %}{% set loop_start=0 %}{% if messages[0]['role']=='system' %}{% set loop_start = 1 %}{% set system_message = '### Instruction: ' ~ messages[0]['content'] ~ '\nComplete the conversation below between [|Human|] and [|AI|]:\n### Input:' %}{% else %}{% set system_message = '### Instruction: Your name is Jais, and you are named after Jebel Jais, the highest mountain in UAE. You were made by Inception in the UAE. You are a helpful, respectful, and honest assistant. Always answer as helpfully as possible, while being safe. Complete the conversation below between [|Human|] and [|AI|]:\n### Input:' %}{% endif %}{% for i in range(loop_start, messages | length) %}{% set message = messages[i] %}{% if i == loop_start %}{% set content = system_message %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{% if i == loop_start %}{{ content ~ ' [|Human|] ' ~ message['content'] }}{% else %}{{ '\n[|Human|] ' ~ content | trim }}{% endif %}{% elif message['role'] == 'assistant' %}{{ '\n[|AI|] ' ~ content | trim }}{% endif %}{% endfor %}{% if add_generation_prompt and messages[messages | length - 1]['role'] != 'assistant' %}{{ '\n[|AI|]\n### Response:' }}{% endif %}"
616
+ />
617
  <clean_up_tokenization_spaces />
618
  <detokenizer_input_type value="i64" />
619
  <eos_token_id value="0" />