From e1efcc75a839c5141468fc4903bedabf1e8b63a1 Mon Sep 17 00:00:00 2001 From: songsenand Date: Thu, 9 Apr 2026 08:01:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(base.html):=20=E4=BC=98=E5=8C=96=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=B7=E5=BC=8F=E4=B8=8E=E7=BB=93=E6=9E=84=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E5=8D=87=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/templates/base.html | 485 ++++++++++++++++----------------- src/model/templates/index.html | 406 +++++++++++++-------------- src/model/trainer.py | 17 +- 3 files changed, 429 insertions(+), 479 deletions(-) diff --git a/src/model/templates/base.html b/src/model/templates/base.html index b3dde16..5042d5e 100644 --- a/src/model/templates/base.html +++ b/src/model/templates/base.html @@ -1,256 +1,245 @@ - - - - - - {% block title %}AI模型训练监控看板{% endblock %} - - - - - - - {% block extra_css %}{% endblock %} - - - - -
-
- {% block content %}{% endblock %} -
-
- - - - - - {% block extra_js %}{% endblock %} - + + +
+
{% block content %}{% endblock %}
+
+ + + + + + {% block extra_js %}{% endblock %} + diff --git a/src/model/templates/index.html b/src/model/templates/index.html index 8d016b8..e2cb27f 100644 --- a/src/model/templates/index.html +++ b/src/model/templates/index.html @@ -1,60 +1,116 @@ -{% extends "base.html" %} - -{% block content %} -
-
+{% extends "base.html" %} {% block content %} +
+
- +
-
+ - -
+ +
- +
- -
+ +
-
- +
0
@@ -86,23 +142,30 @@
- +
-
0.0000
+
+ 0.0000 +
训练损失
- +
-
0.0000
+
+ 0.0000 +
训练准确率
-
+
- +
0.0000
@@ -110,23 +173,33 @@
- +
-
0.0000
+
+ 0.0000 +
评估准确率
-
+
- +
-
0.00e+0
+
+ 0.00e+0 +
学习率
-
+
- +
0
@@ -138,39 +211,39 @@
- +
-
+

损失曲线

- +
-
+

准确率曲线

- +
-
+

学习率变化

- +
-
-

数据详情

-
+
+

数据详情

+
-
+
@@ -186,35 +259,19 @@ - +
加载数据中... + 加载数据中... +
- +
-{% endblock %} - -{% block extra_js %} +{% endblock %} {% block extra_js %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/model/trainer.py b/src/model/trainer.py index 7b384d6..3c9a4f5 100644 --- a/src/model/trainer.py +++ b/src/model/trainer.py @@ -1232,25 +1232,10 @@ def expand_and_train( num_experts: int = typer.Option(20, "--num-experts", help="MoE专家数量"), max_seq_len: int = typer.Option(128, "--max-seq-len", help="最大序列长度"), use_pinyin: bool = typer.Option(False, "--use-pinyin", help="是否使用拼音特征"), - # 两阶段训练参数 - frozen_patience: int = typer.Option( - 10, - "--frozen-patience", - help="冻结阶段验证损失连续不下降的epoch数,触发切换到全量微调", - ), - frozen_lr: float = typer.Option(1e-3, "--frozen-lr", help="冻结阶段学习率"), - full_lr: float = typer.Option(1e-4, "--full-lr", help="全量微调阶段学习率"), - frozen_scheduler: str = typer.Option( - "cosine", "--frozen-scheduler", help="冻结阶段学习率调度器类型:cosine或plateau" - ), - full_scheduler: str = typer.Option( - "cosine", - "--full-scheduler", - help="全量微调阶段学习率调度器类型:cosine或plateau", - ), # 训练参数 batch_size: int = typer.Option(128, "--batch-size", "-b", help="批次大小"), num_epochs: int = typer.Option(10, "--num-epochs", help="训练轮数"), + learning_rate: float = typer.Option(1e-5, "--learning-rate", "-lr", help="学习率"), min_learning_rate: float = typer.Option( 1e-9, "--min-learning-rate", help="最小学习率" ),