From 9773534181a141138cd4e5d12b939a1d66273a79 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 1 Aug 2023 07:57:47 -0700 Subject: [PATCH] Update Chat-mode.md --- docs/Chat-mode.md | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/docs/Chat-mode.md b/docs/Chat-mode.md index 08dd290d..065e6a9a 100644 --- a/docs/Chat-mode.md +++ b/docs/Chat-mode.md @@ -1,36 +1,30 @@ ## Chat characters -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) +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). The following fields may be defined: | Field | Description | |-------|-------------| | `name` or `bot` | The character's name. | +| `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. | +| `greeting` (optional) | The character's opening message. It appears when the character is first loaded or when the history is cleared. | | `your_name` or `user` (optional) | Your name. This overwrites what you had previously written in the `Your name` field in the interface. | -| `context` | A string that appears at the top of the prompt. It usually contains a description of the character's personality. | -| `greeting` (optional) | The character's opening message when a new conversation is started. | -| `example_dialogue` (optional) | A few example messages to guide the model. | -| `turn_template` (optional) | Used to define where the spaces and new line characters should be in Instruct mode. See the characters in `characters/instruction-following` for examples. | #### Special tokens -* `{{char}}` or ``: are replaced with the character's name -* `{{user}}` or ``: are replaced with your name +The following replacements happen when the prompt is generated, and they apply to the `context` and `greeting` fields: -These replacements happen when the character is loaded, and they apply to the `context`, `greeting`, and `example_dialogue` fields. +* `{{char}}` and `` get replaced with the character's name. +* `{{user}}` and `` get replaced with your name. #### How do I add a profile picture for my character? -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. +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. #### Is the chat history truncated in the prompt? -Once your prompt reaches the 2048 token limit, 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. - -#### Pygmalion format characters - -These are also supported out of the box. Simply put the JSON file in the `characters` folder, or upload it directly from the web UI by clicking on the "Upload character" tab at the bottom. +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. ## Chat styles