初始化项目,由ModelHub XC社区提供模型
Model: rita-cohere/tya-eng-v1 Source: Original Platform
This commit is contained in:
77
chat_template.jinja
Normal file
77
chat_template.jinja
Normal file
@@ -0,0 +1,77 @@
|
||||
{%- set skip_preamble = skip_preamble | default(false) -%}
|
||||
{%- set skip_thinking = skip_thinking | default(false) -%}
|
||||
{{- bos_token -}}
|
||||
{%- if skip_preamble -%}
|
||||
{%- if preamble -%}
|
||||
{{- "<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>" -}}
|
||||
{{- preamble -}}
|
||||
{{- "<|END_OF_TURN_TOKEN|>" -}}
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
{{- "<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\n" -}}
|
||||
{{- "You are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n" -}}
|
||||
{{- "Your information cutoff date is June 2024.\n" -}}
|
||||
{{- "You have been trained on data in English, Dutch, French, Italian, Portuguese, Romanian, Spanish, Czech, Polish, Ukrainian, Russian, Greek, German, Danish, Swedish, Norwegian, Catalan, Galician, Welsh, Irish, Basque, Croatian, Latvian, Lithuanian, Slovak, Slovenian, Estonian, Finnish, Hungarian, Serbian, Bulgarian, Arabic, Persian, Urdu, Turkish, Maltese, Hebrew, Hindi, Marathi, Bengali, Gujarati, Punjabi, Tamil, Telugu, Nepali, Tagalog, Malay, Indonesian, Vietnamese, Javanese, Khmer, Thai, Lao, Chinese, Burmese, Japanese, Korean, Amharic, Hausa, Igbo, Malagasy, Shona, Swahili, Wolof, Xhosa, Yoruba and Zulu but have the ability to speak many more languages.\n" -}}
|
||||
{{- "# Default Preamble\n" -}}
|
||||
{{- "The following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n" -}}
|
||||
{{- "- Your name is Aya.\n" -}}
|
||||
{{- "- You are a large language model built by Cohere.\n" -}}
|
||||
{{- "- When responding in English, use American English unless context indicates otherwise.\n" -}}
|
||||
{{- "- When outputting responses of more than seven sentences, split the response into paragraphs.\n" -}}
|
||||
{{- "- Prefer the active voice.\n" -}}
|
||||
{{- "- Use gender-neutral pronouns for unspecified persons.\n" -}}
|
||||
{{- "- When generating code output without specifying the programming language, please generate Python code." -}}
|
||||
{%- if preamble is defined and preamble -%}
|
||||
{{- "\n# Developer Preamble\n" -}}
|
||||
{{- "The following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n" -}}
|
||||
{{- preamble -}}
|
||||
{%- endif -%}
|
||||
{{- "<|END_OF_TURN_TOKEN|>" -}}
|
||||
{%- endif -%}
|
||||
{%- for message in messages -%}
|
||||
{#- normalize: a bare string content becomes a single text block -#}
|
||||
{%- if message.content is string -%}
|
||||
{%- set content = [{"type": "text", "data": message.content}] -%}
|
||||
{%- else -%}
|
||||
{%- set content = message.content -%}
|
||||
{%- endif -%}
|
||||
{{- "<|START_OF_TURN_TOKEN|>" -}}
|
||||
{%- set msg_role_downcased = message.role | lower -%}
|
||||
{{- msg_role_downcased | replace("user", "<|USER_TOKEN|>") | replace("chatbot", "<|CHATBOT_TOKEN|>") | replace("assistant", "<|CHATBOT_TOKEN|>") | replace("system", "<|SYSTEM_TOKEN|>") -}}
|
||||
{%- if msg_role_downcased == "chatbot" or msg_role_downcased == "assistant" -%}
|
||||
{%- if content | length > 0 and content[0].type == "thinking" and not skip_thinking -%}
|
||||
{{- "<|START_THINKING|>" -}}
|
||||
{{- content[0].data -}}
|
||||
{{- "<|END_THINKING|>" -}}
|
||||
{%- endif -%}
|
||||
{{- "<|START_RESPONSE|>" -}}
|
||||
{%- if content | length > 0 and content[0].type == "text" -%}
|
||||
{{- content[0].data -}}
|
||||
{%- elif content | length > 1 and content[1].type == "text" -%}
|
||||
{{- content[1].data -}}
|
||||
{%- endif -%}
|
||||
{{- "<|END_RESPONSE|>" -}}
|
||||
{%- else -%}
|
||||
{%- set last_was_text = namespace(value=false) -%}
|
||||
{%- for content_item in content -%}
|
||||
{%- if content_item.type == "text" -%}
|
||||
{%- if last_was_text.value -%}
|
||||
{{- "\n" -}}
|
||||
{%- endif -%}
|
||||
{{- content_item.data -}}
|
||||
{%- set last_was_text.value = true -%}
|
||||
{%- else -%}
|
||||
{{- content_item.data -}}
|
||||
{%- set last_was_text.value = false -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
{{- "<|END_OF_TURN_TOKEN|>" -}}
|
||||
{%- endfor -%}
|
||||
{{- "<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" -}}
|
||||
{%- if reasoning_options is defined and reasoning_options and reasoning_options.enabled -%}
|
||||
{{- "<|START_THINKING|>" -}}
|
||||
{%- else -%}
|
||||
{{- "<|START_THINKING|><|END_THINKING|>" -}}
|
||||
{%- endif -%}
|
||||
|
||||
Reference in New Issue
Block a user