From ece3b3737e7b07895b556a7cc02dd841a2d84e8e Mon Sep 17 00:00:00 2001 From: hiyouga Date: Thu, 29 Feb 2024 00:46:47 +0800 Subject: [PATCH] tiny fix and release --- src/llmtuner/webui/components/chatbot.py | 8 ++--- src/llmtuner/webui/locales.py | 44 ++++++++++++------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/llmtuner/webui/components/chatbot.py b/src/llmtuner/webui/components/chatbot.py index 802954da..7713bda2 100644 --- a/src/llmtuner/webui/components/chatbot.py +++ b/src/llmtuner/webui/components/chatbot.py @@ -21,18 +21,18 @@ def create_chat_box( messages = gr.State([]) with gr.Row(): with gr.Column(scale=4): + role = gr.Dropdown(choices=[Role.USER.value, Role.OBSERVATION.value], value=Role.USER.value) system = gr.Textbox(show_label=False) tools = gr.Textbox(show_label=False, lines=2) - role = gr.Dropdown(choices=[Role.USER.value, Role.OBSERVATION.value], value=Role.USER.value) query = gr.Textbox(show_label=False, lines=8) submit_btn = gr.Button(variant="primary") with gr.Column(scale=1): - clear_btn = gr.Button() gen_kwargs = engine.chatter.generating_args max_new_tokens = gr.Slider(10, 2048, value=gen_kwargs.max_new_tokens, step=1) top_p = gr.Slider(0.01, 1, value=gen_kwargs.top_p, step=0.01) temperature = gr.Slider(0.01, 1.5, value=gen_kwargs.temperature, step=0.01) + clear_btn = gr.Button() tools.input(check_json_schema, [tools, engine.manager.get_elem_by_name("top.lang")]) @@ -50,14 +50,14 @@ def create_chat_box( chatbot, messages, dict( + role=role, system=system, tools=tools, - role=role, query=query, submit_btn=submit_btn, - clear_btn=clear_btn, max_new_tokens=max_new_tokens, top_p=top_p, temperature=temperature, + clear_btn=clear_btn, ), ) diff --git a/src/llmtuner/webui/locales.py b/src/llmtuner/webui/locales.py index e2a1aa81..aaf8c4bc 100644 --- a/src/llmtuner/webui/locales.py +++ b/src/llmtuner/webui/locales.py @@ -839,6 +839,17 @@ LOCALES = { "value": "模型未加载,请先加载模型。", }, }, + "role": { + "en": { + "label": "Role", + }, + "ru": { + "label": "Роль", + }, + "zh": { + "label": "角色", + }, + }, "system": { "en": { "placeholder": "System prompt (optional)", @@ -861,17 +872,6 @@ LOCALES = { "placeholder": "工具列表(非必填)", }, }, - "role": { - "en": { - "label": "Role", - }, - "ru": { - "label": "Роль", - }, - "zh": { - "label": "角色", - }, - }, "query": { "en": { "placeholder": "Input...", @@ -894,17 +894,6 @@ LOCALES = { "value": "提交", }, }, - "clear_btn": { - "en": { - "value": "Clear history", - }, - "ru": { - "value": "Очистить историю", - }, - "zh": { - "value": "清空历史", - }, - }, "max_length": { "en": { "label": "Maximum length", @@ -949,6 +938,17 @@ LOCALES = { "label": "温度系数", }, }, + "clear_btn": { + "en": { + "value": "Clear history", + }, + "ru": { + "value": "Очистить историю", + }, + "zh": { + "value": "清空历史", + }, + }, "max_shard_size": { "en": { "label": "Max shard size (GB)",