rodrigomasini commited on
Commit
d612691
1 Parent(s): a5c5f76

Create docs/chat-mode.md

Browse files
Files changed (1) hide show
  1. docs/chat-mode.md +39 -0
docs/chat-mode.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Chat characters
2
+
3
+ Custom chat mode characters are defined by `.yaml` files inside the `characters` folder. An example is included: [Example.yaml](https://github.com/oobabooga/text-generation-webui/blob/main/characters/Example.yaml).
4
+
5
+ The following fields may be defined:
6
+
7
+ | Field | Description |
8
+ |-------|-------------|
9
+ | `name` or `bot` | The character's name. |
10
+ | `context` | A string that appears at the top of the prompt. It usually contains a description of the character's personality and a few example messages. |
11
+ | `greeting` (optional) | The character's opening message. It appears when the character is first loaded or when the history is cleared. |
12
+ | `your_name` or `user` (optional) | Your name. This overwrites what you had previously written in the `Your name` field in the interface. |
13
+
14
+ #### Special tokens
15
+
16
+ The following replacements happen when the prompt is generated, and they apply to the `context` and `greeting` fields:
17
+
18
+ * `{{char}}` and `<BOT>` get replaced with the character's name.
19
+ * `{{user}}` and `<USER>` get replaced with your name.
20
+
21
+ #### How do I add a profile picture for my character?
22
+
23
+ Put an image with the same name as your character's `.yaml` file into the `characters` folder. For example, if your bot is `Character.yaml`, add `Character.jpg` or `Character.png` to the folder.
24
+
25
+ #### Is the chat history truncated in the prompt?
26
+
27
+ Once your prompt reaches the `truncation_length` parameter (2048 by default), old messages will be removed one at a time. The context string will always stay at the top of the prompt and will never get truncated.
28
+
29
+ ## Chat styles
30
+
31
+ Custom chat styles can be defined in the `text-generation-webui/css` folder. Simply create a new file with name starting in `chat_style-` and ending in `.css` and it will automatically appear in the "Chat style" dropdown menu in the interface. Examples:
32
+
33
+ ```
34
+ chat_style-cai-chat.css
35
+ chat_style-TheEncrypted777.css
36
+ chat_style-wpp.css
37
+ ```
38
+
39
+ You should use the same class names as in `chat_style-cai-chat.css` in your custom style.