How to pass system prompts when using Mistral?

#73
by luissimoes - opened

Currently need Mistral to generate predictable JSON output based on certain user prompts.

Official format:

<s>[INST] System Prompt + Instruction [/INST] Model answer</s>[INST] Follow-up instruction [/INST]

Please note that the system prompts appears only before the first turn and not in suebsequent turns.

Source.

Currently need Mistral to generate predictable JSON output based on certain user prompts.

Have a look at this article: How to use Mistral AI Instruct model to generate structured content similar to Open AI functions

Currently need Mistral to generate predictable JSON output based on certain user prompts.

Have a look at this article: How to use Mistral AI Instruct model to generate structured content similar to Open AI functions

This looks nice, especially the promptless approach.

Currently need Mistral to generate predictable JSON output based on certain user prompts.

In the past, I did it using Llama 2, which worked great. I have the detailed schema described in the prompt.

Just yesterday I switched to Mistral. I see that the JSON is still generated following the schema. However, there also appears to be the same, unstructured content generated again after the JSON ends. For now, I just consider the content between the triple backticks (```).

Here's the template if you want to have a look: https://huggingface.co/spaces/barunsaha/slide-deck-ai/blob/main/langchain_templates/template_combined.txt

Very nice template, indeed :) thank you for sharing.

Thanks for Sharing!

Sign up or log in to comment