feat: 搭建应用基础框架

包含应用入口、根组件、路由配置(含登录守卫)、主布局、全局样式、ECharts 插件、类型定义、常量映射表及静态资源。
This commit is contained in:
caoxiaozhu
2026-07-10 16:44:49 +08:00
parent 855308e5fa
commit 8aa67003c8
11 changed files with 1112 additions and 0 deletions

View File

@@ -0,0 +1,144 @@
/**
* 全局常量与映射表
*/
/** 模型类型 */
export const MODEL_TYPE_MAP: Record<string, string> = {
LLM: '大语言模型',
CV: '计算机视觉',
NLP: '自然语言处理',
Embedding: '向量模型',
Other: '其他',
}
/** 模型用途 */
export const PURPOSE_MAP: Record<string, { text: string; type: string }> = {
training: { text: '训练', type: 'primary' },
inference: { text: '推理', type: 'success' },
evaluation: { text: '评测', type: 'warning' },
}
/** 模型来源 */
export const MODEL_SOURCE_MAP: Record<string, string> = {
local: '本地模型',
api: '在线模型',
online: '在线模型',
}
/** 训练方式 */
export const TRAIN_TYPE_MAP: Record<string, string> = {
SFT: 'SFT',
DPO: 'DPO',
CPT: 'CPT',
}
/** 训练方法 */
export const TRAIN_METHOD_MAP: Record<string, string> = {
lora: 'LoRA',
qlora: 'QLoRA',
full: '全量微调',
prefix: 'Prefix Tuning',
adapter: 'Adapter',
peft: 'PEFT',
adalora: 'AdaLoRA',
longlora: 'LongLoRA',
dpo: 'DPO',
cpt: 'CPT',
}
/** 数据集类型 */
export const DATASET_TYPE_MAP: Record<string, string> = {
train: '训练数据',
test: '测试数据',
eval: '评测数据',
val: '验证数据',
other: '其他',
}
/** 存储位置 */
export const STORAGE_MAP: Record<string, string> = {
local: '本地存储',
minio: 'MinIO',
cloud: '云存储',
}
/** 评测维度指标类型 */
export const DIMENSION_TYPE_MAP: Record<string, string> = {
classification: '大模型-分类型',
metric: '大模型-指标型',
text_similarity: '规则-文本相似度',
}
/** 学习率调度器类型 */
export const LR_SCHEDULER_OPTIONS = [
{ label: 'cosine', value: 'cosine' },
{ label: 'linear', value: 'linear' },
{ label: 'constant', value: 'constant' },
]
/** 训练模板分组(按模型系列) */
export const TEMPLATE_GROUPS: { label: string; options: { label: string; value: string }[] }[] = [
{
label: 'Qwen 系列',
options: [
{ label: 'qwen', value: 'qwen' },
{ label: 'qwen2', value: 'qwen2' },
{ label: 'qwen2_5', value: 'qwen2_5' },
],
},
{
label: 'Llama 系列',
options: [
{ label: 'llama2', value: 'llama2' },
{ label: 'llama3', value: 'llama3' },
{ label: 'llama3_1', value: 'llama3_1' },
],
},
{
label: 'DeepSeek 系列',
options: [
{ label: 'deepseek', value: 'deepseek' },
{ label: 'deepseek2', value: 'deepseek2' },
],
},
{
label: '其他系列',
options: [
{ label: 'glm4', value: 'glm4' },
{ label: 'chatglm3', value: 'chatglm3' },
{ label: 'gemma', value: 'gemma' },
{ label: 'gemma2', value: 'gemma2' },
{ label: 'phi', value: 'phi' },
{ label: 'intern2', value: 'intern2' },
{ label: 'mistral', value: 'mistral' },
{ label: 'default', value: 'default' },
],
},
]
/** 默认工具列表(其他工具页) */
export const DEFAULT_TOOLS = [
{ id: 'data-generate', name: '数据生成', icon: 'fa-database', description: '基于LLM生成微调数据集' },
{ id: 'json2jsonl', name: 'JSON转JSONL', icon: 'fa-code', description: '将JSON文件转换为JSONL格式' },
{ id: 'md-convert', name: '转换Markdown', icon: 'fa-file-text', description: '将Markdown文件转换为训练数据' },
]
/** 自定义工具可选图标 */
export const TOOL_ICONS = [
'fa-cog', 'fa-database', 'fa-code', 'fa-file-text', 'fa-wrench', 'fa-cube',
'fa-line-chart', 'fa-bar-chart', 'fa-server', 'fa-cogs', 'fa-tasks', 'fa-trophy',
'fa-sliders', 'fa-rocket', 'fa-cloud', 'fa-cloud-download', 'fa-microchip',
'fa-hdd-o', 'fa-globe', 'fa-info-circle', 'fa-question-circle-o', 'fa-user-o',
'fa-lock-o', 'fa-sign-in', 'fa-sign-out', 'fa-search', 'fa-plus', 'fa-refresh',
'fa-times', 'fa-check', 'fa-pencil', 'fa-trash', 'fa-play', 'fa-arrow-left',
'fa-arrow-down', 'fa-arrow-up',
]
/** 会话超时5 分钟 */
export const SESSION_TIMEOUT = 5 * 60 * 1000
/** 系统监控刷新间隔 */
export const METRICS_INTERVAL = 30000
/** 训练进度刷新间隔 */
export const TRAINING_REFRESH_INTERVAL = 5000