Files
YG_FT/README.md
caoxiaozhu 89881a4307 readme
2026-07-10 16:52:39 +08:00

134 lines
3.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# YG_FT
远光微调平台 - 面向大语言模型的微调、评测、推理与对比一体化前端。
## 技术栈
| 类别 | 技术 | 版本 |
|------|------|------|
| 框架 | Vue 3 | ^3.5.13 |
| 语言 | TypeScript | ~5.7.2 |
| 构建工具 | Vite | ^6.0.7 |
| 路由 | Vue Router | ^4.5.0 |
| 状态管理 | Pinia | ^2.3.0 |
| UI 组件库 | Element Plus | ^2.9.1 |
| HTTP 客户端 | axios | ^1.7.9 |
| 图表 | ECharts / vue-echarts | ^6.1.0 / ^8.0.1 |
| Markdown | marked + DOMPurify | ^15.0.5 / ^3.2.3 |
| 编辑器 | md-editor-v3 | ^5.1.4 |
| 工具集 | @vueuse/core | ^11.3.0 |
| 样式 | Sass | ^1.83.0 |
**项目版本**1.0.0
## 环境要求
- **Node.js** >= 18推荐 20 LTS
- **npm** >= 9
- 后端服务运行于 `http://localhost:7861`(前端通过代理转发,见下文)
## 快速开始
### 1. 安装依赖
```bash
cd frontend
npm install
```
### 2. 启动开发服务器
```bash
npm run dev
```
开发服务器默认运行在 `http://localhost:6801`
### 3. 构建生产包
```bash
npm run build # 类型检查 + 生产构建,产物输出到 dist/
npm run preview # 本地预览构建产物
```
### 4. 类型检查
```bash
npm run type-check
```
## 测试
内置基于 Playwright 的 UI 回归脚本,首次运行前需安装浏览器:
```bash
npx playwright install chromium
```
执行已注册的回归脚本:
```bash
npm run test:data-process-wizard # 数据处理向导
npm run test:model-manage # 模型管理
npm run test:training-log-layout # 训练日志布局
npm run test:page-surface # 页面表层级
```
其余脚本可直接运行:
```bash
node scripts/regression-back-navigation.mjs # 返回导航
node scripts/regression-fine-tune-create-ui.mjs # 调优创建 UI
```
> 回归脚本默认连接 `http://localhost:6801`,需先启动开发服务器。
## 目录结构
```
YG-FT/
├── frontend/ # 前端工程Vue 3 SPA
│ ├── src/
│ │ ├── api/ # axios 封装 + 各业务模块 API
│ │ ├── components/ # 公共组件
│ │ ├── composables/ # 组合式函数
│ │ ├── constants/ # 常量与映射表
│ │ ├── layouts/ # 主布局
│ │ ├── mock/ # Mock 数据与适配器
│ │ ├── plugins/ # 第三方插件注册
│ │ ├── router/ # 路由配置 + 登录守卫
│ │ ├── stores/ # Pinia 状态
│ │ ├── styles/ # 全局样式
│ │ ├── types/ # TypeScript 类型定义
│ │ └── views/ # 业务页面
│ ├── scripts/ # UI 回归测试脚本
│ ├── public/ # 静态资源
│ └── vite.config.ts # Vite 构建与代理配置
├── docs/ # 设计文档与视觉走查记录
└── design-qa.md # 视觉走查汇总
```
## 端口与代理
| 服务 | 地址 |
|------|------|
| 前端开发服务器 | `http://localhost:6801` |
| 后端 API | `http://localhost:7861` |
前端统一使用 `/api` 相对路径发请求,由 Vite 开发代理转发到后端 `http://localhost:7861`(配置见 `frontend/vite.config.ts`)。
## 业务模块
| 模块 | 说明 |
|------|------|
| 登录 | 用户登录鉴权 |
| 模型调优 | 微调任务创建与管理 |
| 模型评测 | 评测任务与评测维度配置 |
| 模型推理 | 在线推理对话 |
| 模型对比 | 多模型对话与结果对比 |
| 模型管理 | 模型 CRUD 与权重合并 |
| 数据集 | 数据集管理与预览 |
| 数据处理 | 数据处理任务向导 |
| 工具 | 辅助工具集 |
| 系统 | 硬件监控、日志、训练日志 |