mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-12-22 23:00:36 +08:00
[model] add seed coder and qwen3 quant models (#8039)
This commit is contained in:
@@ -18,7 +18,7 @@ from ...data import TEMPLATES
|
||||
from ...extras.constants import METHODS, SUPPORTED_MODELS
|
||||
from ...extras.packages import is_gradio_available
|
||||
from ..common import save_config
|
||||
from ..control import can_quantize, can_quantize_to, get_model_info, list_checkpoints
|
||||
from ..control import can_quantize, can_quantize_to, check_template, get_model_info, list_checkpoints
|
||||
|
||||
|
||||
if is_gradio_available():
|
||||
@@ -49,7 +49,7 @@ def create_top() -> dict[str, "Component"]:
|
||||
|
||||
model_name.change(get_model_info, [model_name], [model_path, template], queue=False).then(
|
||||
list_checkpoints, [model_name, finetuning_type], [checkpoint_path], queue=False
|
||||
)
|
||||
).then(check_template, [lang, template])
|
||||
model_name.input(save_config, inputs=[lang, model_name], queue=False)
|
||||
model_path.input(save_config, inputs=[lang, model_name, model_path], queue=False)
|
||||
finetuning_type.change(can_quantize, [finetuning_type], [quantization_bit], queue=False).then(
|
||||
|
||||
@@ -84,6 +84,17 @@ def get_model_info(model_name: str) -> tuple[str, str]:
|
||||
return get_model_path(model_name), get_template(model_name)
|
||||
|
||||
|
||||
def check_template(lang: str, template: str) -> None:
|
||||
r"""Check if an instruct model is used.
|
||||
|
||||
Please use queue=True to show the warning message.
|
||||
|
||||
Inputs: top.lang, top.template
|
||||
"""
|
||||
if template == "default":
|
||||
gr.Warning(ALERTS["warn_no_instruct"][lang])
|
||||
|
||||
|
||||
def get_trainer_info(lang: str, output_path: os.PathLike, do_train: bool) -> tuple[str, "gr.Slider", dict[str, Any]]:
|
||||
r"""Get training infomation for monitor.
|
||||
|
||||
|
||||
@@ -2796,6 +2796,13 @@ ALERTS = {
|
||||
"ko": "출력 디렉토리가 이미 존재합니다. 위 출력 디렉토리에 저장된 학습을 재개합니다.",
|
||||
"ja": "出力ディレクトリが既に存在します。このチェックポイントからトレーニングを再開します。",
|
||||
},
|
||||
"warn_no_instruct": {
|
||||
"en": "You are using a non-instruct model, please fine-tune it first.",
|
||||
"ru": "Вы используете модель без инструкции, пожалуйста, primeros выполните донастройку этой модели.",
|
||||
"zh": "您正在使用非指令模型,请先对其进行微调。",
|
||||
"ko": "당신은 지시하지 않은 모델을 사용하고 있습니다. 먼저 이를 미세 조정해 주세요.",
|
||||
"ja": "インストラクションモデルを使用していません。まずモデルをアダプターに適合させてください。",
|
||||
},
|
||||
"info_aborting": {
|
||||
"en": "Aborted, wait for terminating...",
|
||||
"ru": "Прервано, ожидание завершения...",
|
||||
|
||||
Reference in New Issue
Block a user