tiny fix and release

This commit is contained in:
hiyouga 2024-02-29 00:46:47 +08:00
parent 7c87532476
commit ece3b3737e
2 changed files with 26 additions and 26 deletions

View File

@ -21,18 +21,18 @@ def create_chat_box(
messages = gr.State([]) messages = gr.State([])
with gr.Row(): with gr.Row():
with gr.Column(scale=4): 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) system = gr.Textbox(show_label=False)
tools = gr.Textbox(show_label=False, lines=2) 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) query = gr.Textbox(show_label=False, lines=8)
submit_btn = gr.Button(variant="primary") submit_btn = gr.Button(variant="primary")
with gr.Column(scale=1): with gr.Column(scale=1):
clear_btn = gr.Button()
gen_kwargs = engine.chatter.generating_args gen_kwargs = engine.chatter.generating_args
max_new_tokens = gr.Slider(10, 2048, value=gen_kwargs.max_new_tokens, step=1) 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) 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) 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")]) tools.input(check_json_schema, [tools, engine.manager.get_elem_by_name("top.lang")])
@ -50,14 +50,14 @@ def create_chat_box(
chatbot, chatbot,
messages, messages,
dict( dict(
role=role,
system=system, system=system,
tools=tools, tools=tools,
role=role,
query=query, query=query,
submit_btn=submit_btn, submit_btn=submit_btn,
clear_btn=clear_btn,
max_new_tokens=max_new_tokens, max_new_tokens=max_new_tokens,
top_p=top_p, top_p=top_p,
temperature=temperature, temperature=temperature,
clear_btn=clear_btn,
), ),
) )

View File

@ -839,6 +839,17 @@ LOCALES = {
"value": "模型未加载,请先加载模型。", "value": "模型未加载,请先加载模型。",
}, },
}, },
"role": {
"en": {
"label": "Role",
},
"ru": {
"label": "Роль",
},
"zh": {
"label": "角色",
},
},
"system": { "system": {
"en": { "en": {
"placeholder": "System prompt (optional)", "placeholder": "System prompt (optional)",
@ -861,17 +872,6 @@ LOCALES = {
"placeholder": "工具列表(非必填)", "placeholder": "工具列表(非必填)",
}, },
}, },
"role": {
"en": {
"label": "Role",
},
"ru": {
"label": "Роль",
},
"zh": {
"label": "角色",
},
},
"query": { "query": {
"en": { "en": {
"placeholder": "Input...", "placeholder": "Input...",
@ -894,17 +894,6 @@ LOCALES = {
"value": "提交", "value": "提交",
}, },
}, },
"clear_btn": {
"en": {
"value": "Clear history",
},
"ru": {
"value": "Очистить историю",
},
"zh": {
"value": "清空历史",
},
},
"max_length": { "max_length": {
"en": { "en": {
"label": "Maximum length", "label": "Maximum length",
@ -949,6 +938,17 @@ LOCALES = {
"label": "温度系数", "label": "温度系数",
}, },
}, },
"clear_btn": {
"en": {
"value": "Clear history",
},
"ru": {
"value": "Очистить историю",
},
"zh": {
"value": "清空历史",
},
},
"max_shard_size": { "max_shard_size": {
"en": { "en": {
"label": "Max shard size (GB)", "label": "Max shard size (GB)",