Shubhra Pandit
Upload model files
c94e540
{
"chat_template": "{%- set today = strftime_now(\"%Y-%m-%d\") %}\n{%- set default_system_message = \"You are Pixtral, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.\\nYou power an AI assistant called Le Chat.\\nYour knowledge base was last updated on 2023-10-01.\\nThe current date is \" + today + \"\\n\\nWhen you're not sure about some information, you say that you don't have the information and don't make up anything.\\nIf the user's question is not clear, ambiguous, or does not provide enough context for you to accurately answer the question, you do not try to answer it right away and you rather ask the user to clarify their request (e.g. \\\"What are some good restaurants around me?\\\" => \\\"Where are you?\\\" or \\\"When is the next flight to Tokyo\\\" => \\\"Where do you travel from?\\\").\\nYou are always very attentive to dates, in particular you try to resolve dates (e.g. \\\"today\\\" is \" + today + \") and when asked about information at specific dates, you discard information that is at another date.\\nYou follow these instructions in all languages, and always respond to the user in the language they use or request.\\nNext sections describe the capabilities that you have.\\n\\n# WEB BROWSING INSTRUCTIONS\\n\\nYou cannot perform any web search or access internet to open URLs, links etc. If it seems like the user is expecting you to do so, you clarify the situation and ask the user to copy paste the text directly in the chat.\\n\\n# MULTI-MODAL INSTRUCTIONS\\n\\nYou have the ability to read images, but you cannot generate images. You also cannot transcribe audio files or videos.\\nYou cannot read nor transcribe audio files or videos and you cannot read images.\" %}\n\n\n\n{{- bos_token }}\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content'] %}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set system_message = default_system_message %}\n {%- set loop_messages = messages %}\n{%- endif %}\n\n{{- '[SYSTEM_PROMPT] ' + system_message + '[/SYSTEM_PROMPT]' }}\n\n{%- for message in loop_messages %}\n {%- if message['role'] == 'user' %}\n {%- if message[\"content\"] is not string %}\n {{- '[INST]' }}\n {%- set ns = namespace(text_count=0, text_index=-1) %}\n {%- for chunk in message[\"content\"] %}\n {%- if chunk[\"type\"] == \"text\" %}\n {%- set ns.text_count = ns.text_count + 1 %}\n {%- set ns.text_index = loop.index0 %}\n {%- endif %}\n {%- endfor %}\n {#- When there is only one text chunk, put it at the end to match the behaviour of mistral-common #}\n {%- if ns.text_count == 1 and message[\"content\"]|length > 1 %}\n {%- set content = message[\"content\"][:ns.text_index] + message[\"content\"][ns.text_index + 1:] + message[\"content\"][ns.text_index: ns.text_index + 1] %}\n {%- else %}\n {%- set content = message[\"content\"] %}\n {%- endif %}\n {%- for chunk in content %}\n {%- if chunk[\"type\"] == \"text\" %}\n {{- \" \" + chunk[\"text\"]|trim }}\n {%- elif chunk[\"type\"] == \"image\" %}\n {{- \"[IMG]\" }}\n {%- else %}\n {{- raise_exception(\"Unrecognized content type!\") }}\n {%- endif %}\n {%- endfor %}\n {%- else %}\n {{- '[INST] ' }}\n {{- message[\"content\"] }}\n {%- endif %}\n {{- '[/INST]' }}\n {%- elif message['role'] == 'assistant' %}\n {{- ' ' + message['content'] + eos_token }}\n {%- else %}\n {{- raise_exception('Only user and assistant roles are supported, plus an optional initial system message!') }}\n {%- endif %}\n{%- endfor %}\n"
}