Add prompts templates to a markdown doc (#489)
Browse files* Add prompts templates to a markdown doc
* rm line about mistral
- PROMPTS.md +27 -0
- README.md +1 -1
PROMPTS.md
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Prompt templates
|
2 |
+
|
3 |
+
These are the templates used to format the conversation history for different models used in HuggingChat. Set them in your `.env.local` [like so](https://github.com/huggingface/chat-ui#chatprompttemplate).
|
4 |
+
|
5 |
+
## Llama 2
|
6 |
+
|
7 |
+
```env
|
8 |
+
<s>[INST] <<SYS>>\n{{preprompt}}\n<</SYS>>\n\n{{#each messages}}{{#ifUser}}{{content}} [/INST] {{/ifUser}}{{#ifAssistant}}{{content}} </s><s>[INST] {{/ifAssistant}}{{/each}}
|
9 |
+
```
|
10 |
+
|
11 |
+
## CodeLlama
|
12 |
+
|
13 |
+
```env
|
14 |
+
<s>[INST] <<SYS>>\n{{preprompt}}\n<</SYS>>\n\n{{#each messages}}{{#ifUser}}{{content}} [/INST] {{/ifUser}}{{#ifAssistant}}{{content}} </s><s>[INST] {{/ifAssistant}}{{/each}}
|
15 |
+
```
|
16 |
+
|
17 |
+
## Falcon
|
18 |
+
|
19 |
+
```env
|
20 |
+
System: {{preprompt}}\nUser:{{#each messages}}{{#ifUser}}{{content}}\nFalcon:{{/ifUser}}{{#ifAssistant}}{{content}}\nUser:{{/ifAssistant}}{{/each}}
|
21 |
+
```
|
22 |
+
|
23 |
+
## Mistral
|
24 |
+
|
25 |
+
```env
|
26 |
+
<s>{{#each messages}}{{#ifUser}}[INST] {{#if @first}}{{#if @root.preprompt}}{{@root.preprompt}}\n{{/if}}{{/if}} {{content}} [/INST]{{/ifUser}}{{#ifAssistant}}{{content}}</s> {{/ifAssistant}}{{/each}}
|
27 |
+
```
|
README.md
CHANGED
@@ -183,7 +183,7 @@ For example:
|
|
183 |
|
184 |
When quering the model for a chat response, the `chatPromptTemplate` template is used. `messages` is an array of chat messages, it has the format `[{ content: string }, ...]`. To idenify if a message is a user message or an assistant message the `ifUser` and `ifAssistant` block helpers can be used.
|
185 |
|
186 |
-
The following is the default `chatPromptTemplate`, although newlines and indentiation have been added for readability.
|
187 |
|
188 |
```prompt
|
189 |
{{preprompt}}
|
|
|
183 |
|
184 |
When quering the model for a chat response, the `chatPromptTemplate` template is used. `messages` is an array of chat messages, it has the format `[{ content: string }, ...]`. To idenify if a message is a user message or an assistant message the `ifUser` and `ifAssistant` block helpers can be used.
|
185 |
|
186 |
+
The following is the default `chatPromptTemplate`, although newlines and indentiation have been added for readability. You can find the prompts used in production for HuggingChat [here](https://github.com/huggingface/chat-ui/blob/main/PROMPTS.md).
|
187 |
|
188 |
```prompt
|
189 |
{{preprompt}}
|