diff --git a/modules/shared.py b/modules/shared.py index 928747f7..4d873cb9 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -40,8 +40,6 @@ settings = { 'name1': 'You', 'user_bio': '', 'custom_system_message': '', - 'instruction_template_str': "{%- set ns = namespace(found=false) -%}\n{%- for message in messages -%}\n {%- if message['role'] == 'system' -%}\n {%- set ns.found = true -%}\n {%- endif -%}\n{%- endfor -%}\n{%- if not ns.found -%}\n {{- '' + 'Below is an instruction that describes a task. Write a response that appropriately completes the request.' + '\\n\\n' -}}\n{%- endif %}\n{%- for message in messages %}\n {%- if message['role'] == 'system' -%}\n {{- '' + message['content'] + '\\n\\n' -}}\n {%- else -%}\n {%- if message['role'] == 'user' -%}\n {{-'### Instruction:\\n' + message['content'] + '\\n\\n'-}}\n {%- else -%}\n {{-'### Response:\\n' + message['content'] + '\\n\\n' -}}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{-'### Response:\\n'-}}\n{%- endif -%}", - 'chat_template_str': "{%- for message in messages %}\n {%- if message['role'] == 'system' -%}\n {%- if message['content'] -%}\n {{- message['content'] + '\\n\\n' -}}\n {%- endif -%}\n {%- if user_bio -%}\n {{- user_bio + '\\n\\n' -}}\n {%- endif -%}\n {%- else -%}\n {%- if message['role'] == 'user' -%}\n {{- name1 + ': ' + message['content'] + '\\n'-}}\n {%- else -%}\n {{- name2 + ': ' + message['content'] + '\\n' -}}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}", 'preset': 'min_p', 'max_new_tokens': 512, 'max_new_tokens_min': 1, @@ -63,6 +61,8 @@ settings = { 'autoload_model': False, 'dark_theme': True, 'default_extensions': [], + 'instruction_template_str': "{%- set ns = namespace(found=false) -%}\n{%- for message in messages -%}\n {%- if message['role'] == 'system' -%}\n {%- set ns.found = true -%}\n {%- endif -%}\n{%- endfor -%}\n{%- if not ns.found -%}\n {{- '' + 'Below is an instruction that describes a task. Write a response that appropriately completes the request.' + '\\n\\n' -}}\n{%- endif %}\n{%- for message in messages %}\n {%- if message['role'] == 'system' -%}\n {{- '' + message['content'] + '\\n\\n' -}}\n {%- else -%}\n {%- if message['role'] == 'user' -%}\n {{-'### Instruction:\\n' + message['content'] + '\\n\\n'-}}\n {%- else -%}\n {{-'### Response:\\n' + message['content'] + '\\n\\n' -}}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{-'### Response:\\n'-}}\n{%- endif -%}", + 'chat_template_str': "{%- for message in messages %}\n {%- if message['role'] == 'system' -%}\n {%- if message['content'] -%}\n {{- message['content'] + '\\n\\n' -}}\n {%- endif -%}\n {%- if user_bio -%}\n {{- user_bio + '\\n\\n' -}}\n {%- endif -%}\n {%- else -%}\n {%- if message['role'] == 'user' -%}\n {{- name1 + ': ' + message['content'] + '\\n'-}}\n {%- else -%}\n {{- name2 + ': ' + message['content'] + '\\n' -}}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}", } default_settings = copy.deepcopy(settings) diff --git a/settings-template.yaml b/settings-template.yaml index d5ed47c3..b61dc4e0 100644 --- a/settings-template.yaml +++ b/settings-template.yaml @@ -1,31 +1,38 @@ -dark_theme: true show_controls: true start_with: '' mode: chat-instruct chat_style: cai-chat +chat-instruct_command: |- + Continue the chat dialogue below. Write a single reply for the character "<|character|>". + + <|prompt|> prompt-default: QA prompt-notebook: QA +character: Assistant +name1: You +user_bio: '' +custom_system_message: '' preset: min_p max_new_tokens: 512 max_new_tokens_min: 1 max_new_tokens_max: 4096 -negative_prompt: '' -seed: -1 -truncation_length: 2048 +prompt_lookup_num_tokens: 0 max_tokens_second: 0 max_updates_second: 0 -prompt_lookup_num_tokens: 0 -custom_stopping_strings: '' -custom_token_bans: '' auto_max_new_tokens: false ban_eos_token: false add_bos_token: true skip_special_tokens: true stream: true static_cache: false -character: Assistant -name1: You -custom_system_message: '' +truncation_length: 2048 +seed: -1 +custom_stopping_strings: '' +custom_token_bans: '' +negative_prompt: '' +autoload_model: false +dark_theme: true +default_extensions: [] instruction_template_str: |- {%- set ns = namespace(found=false) -%} {%- for message in messages -%} @@ -67,11 +74,4 @@ chat_template_str: |- {%- endif -%} {%- endif -%} {%- endfor -%} -chat-instruct_command: |- - Continue the chat dialogue below. Write a single reply for the character "<|character|>". - <|prompt|> -autoload_model: false -gallery-items_per_page: 50 -gallery-open: false -default_extensions: []