Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mistral Small 3 : chat template with python functions causes error #2987

Open
2 tasks done
v3ss0n opened this issue Feb 3, 2025 · 1 comment
Open
2 tasks done

Mistral Small 3 : chat template with python functions causes error #2987

v3ss0n opened this issue Feb 3, 2025 · 1 comment

Comments

@v3ss0n
Copy link

v3ss0n commented Feb 3, 2025

Model description

Mistral recent comment uses this template

"chat_template": "{%- set today = strftime_now(\"%Y-%m-%d\") %}\n{%- set default_system_message = \"You are Mistral Small 3, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.\\nYour knowledge base was last updated on 2023-10-01. The 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?\\\")\" %}\n\n{{- bos_token }}\n\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{{- '[SYSTEM_PROMPT]' + system_message + '[/SYSTEM_PROMPT]' }}\n\n{%- for message in loop_messages %}\n    {%- if message['role'] == 'user' %}\n        {{- '[INST]' + message['content'] + '[/INST]' }}\n    {%- elif message['role'] == 'system' %}\n        {{- '[SYSTEM_PROMPT]' + message['content'] + '[/SYSTEM_PROMPT]' }}\n    {%- elif message['role'] == 'assistant' %}\n        {{- message['content'] + eos_token }}\n    {%- else %}\n        {{- raise_exception('Only user, system and assistant roles are supported!') }}\n    {%- endif %}\n{%- endfor %}",

causing text-generation-inference to fail with strftime_now is unknown (in <string>:1)

https://huggingface.co/mistralai/Mistral-Small-24B-Instruct-2501/discussions/17

Open source status

  • The model implementation is available
  • The model weights are available

Provide useful links for the implementation

Mistral Small 3

@v3ss0n v3ss0n changed the title Mistral Small 3 : chat template with datetime functions causes error Mistral Small 3 : chat template with python functions causes error Feb 3, 2025
@v3ss0n
Copy link
Author

v3ss0n commented Feb 4, 2025

Its been fixed , in latest commit , but waiting a release to test and confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant