1. 更新了easy-dataset的界面
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
from pydantic_settings import BaseSettings
|
from pydantic_settings import BaseSettings
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
class Settings(BaseSettings):
|
class Settings(BaseSettings):
|
||||||
@@ -16,16 +17,16 @@ class Settings(BaseSettings):
|
|||||||
|
|
||||||
# 日志配置
|
# 日志配置
|
||||||
log_level: str = "INFO"
|
log_level: str = "INFO"
|
||||||
log_file: Optional[str] = "logs/app.log" # 默认写入日志文件
|
log_file: Optional[str] = "logs/app.log"
|
||||||
log_format: str = "json" # json 或 console
|
log_format: str = "json"
|
||||||
log_to_console: bool = False # 是否同时输出到控制台
|
log_to_console: bool = False
|
||||||
|
|
||||||
# 高级日志配置
|
# 高级日志配置
|
||||||
advanced_logging: bool = True # 是否启用高级日志系统
|
advanced_logging: bool = True
|
||||||
logs_dir: str = "logs" # 日志目录
|
logs_dir: str = "logs"
|
||||||
max_log_days: int = 30 # 日志文件保存天数
|
max_log_days: int = 30
|
||||||
enable_log_cleanup: bool = True # 是否启用自动日志清理
|
enable_log_cleanup: bool = True
|
||||||
route_based_logging: bool = True # 是否启用基于路由的日志分类
|
route_based_logging: bool = True
|
||||||
|
|
||||||
# 性能配置
|
# 性能配置
|
||||||
max_requests: int = 1000
|
max_requests: int = 1000
|
||||||
@@ -38,7 +39,8 @@ class Settings(BaseSettings):
|
|||||||
cors_headers: list[str] = ["*"]
|
cors_headers: list[str] = ["*"]
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
env_file = ".env"
|
env_file = str(Path(__file__).parent.parent.parent / ".env")
|
||||||
|
env_file_encoding = "utf-8"
|
||||||
case_sensitive = False
|
case_sensitive = False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -688,6 +688,251 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"/api/datasets/{file_id}": {
|
||||||
|
"delete": {
|
||||||
|
"tags": [
|
||||||
|
"Datasets"
|
||||||
|
],
|
||||||
|
"summary": "delete_dataset",
|
||||||
|
"description": "删除数据集\n\nArgs:\n file_id: 文件ID\n\nReturns:\n StandardResponse: 包含删除结果的标准响应",
|
||||||
|
"operationId": "delete_dataset_api_datasets__file_id__delete",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "file_id",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "File Id"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Successful Response",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/StandardResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "Validation Error",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/HTTPValidationError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"Datasets"
|
||||||
|
],
|
||||||
|
"summary": "get_dataset",
|
||||||
|
"description": "获取特定数据集的详细信息\n\nArgs:\n file_id: 文件ID\n\nReturns:\n StandardResponse: 包含数据集详情的标准响应",
|
||||||
|
"operationId": "get_dataset_api_datasets__file_id__get",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "file_id",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "File Id"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Successful Response",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/StandardResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "Validation Error",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/HTTPValidationError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/datasets/{file_id}/content": {
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"Datasets"
|
||||||
|
],
|
||||||
|
"summary": "get_dataset_content",
|
||||||
|
"description": "获取数据集文件内容(前N条记录)\n\nArgs:\n file_id: 文件ID\n limit: 返回的记录数量,默认5条\n\nReturns:\n StandardResponse: 包含数据集内容的标准响应",
|
||||||
|
"operationId": "get_dataset_content_api_datasets__file_id__content_get",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "file_id",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "File Id"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "limit",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "integer",
|
||||||
|
"default": 5,
|
||||||
|
"title": "Limit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Successful Response",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/StandardResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "Validation Error",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/HTTPValidationError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/datasets/list-files": {
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"Datasets"
|
||||||
|
],
|
||||||
|
"summary": "list_data_files",
|
||||||
|
"description": "查询data目录下的文件列表\n\nReturns:\n StandardResponse: 包含文件列表的标准响应",
|
||||||
|
"operationId": "list_data_files_api_datasets_list_files_get",
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Successful Response",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/StandardResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/datasets": {
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"Datasets"
|
||||||
|
],
|
||||||
|
"summary": "list_datasets",
|
||||||
|
"description": "获取所有数据集列表\n\nArgs:\n list_all: 是否列出data目录下的所有文件(物理文件),默认False(只列出API上传的文件)\n\nReturns:\n StandardResponse: 包含数据集列表的标准响应",
|
||||||
|
"operationId": "list_datasets_api_datasets_get",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "list_all",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false,
|
||||||
|
"title": "List All"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Successful Response",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/StandardResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "Validation Error",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/HTTPValidationError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/datasets/upload": {
|
||||||
|
"post": {
|
||||||
|
"tags": [
|
||||||
|
"Datasets"
|
||||||
|
],
|
||||||
|
"summary": "upload_dataset",
|
||||||
|
"description": "上传数据集文件\n\nArgs:\n file: 上传的文件(支持 .json, .jsonl 格式)\n description: 文件描述(可选)\n\nReturns:\n StandardResponse: 包含上传结果的标准响应",
|
||||||
|
"operationId": "upload_dataset_api_datasets_upload_post",
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"multipart/form-data": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/Body_upload_dataset_api_datasets_upload_post"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Successful Response",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/StandardResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "Validation Error",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/HTTPValidationError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"components": {
|
"components": {
|
||||||
@@ -726,6 +971,31 @@
|
|||||||
"title": "BatchDownloadRequest",
|
"title": "BatchDownloadRequest",
|
||||||
"description": "批量下载请求模型"
|
"description": "批量下载请求模型"
|
||||||
},
|
},
|
||||||
|
"Body_upload_dataset_api_datasets_upload_post": {
|
||||||
|
"properties": {
|
||||||
|
"file": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "binary",
|
||||||
|
"title": "File"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "Description"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"file"
|
||||||
|
],
|
||||||
|
"title": "Body_upload_dataset_api_datasets_upload_post"
|
||||||
|
},
|
||||||
"HTTPValidationError": {
|
"HTTPValidationError": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"detail": {
|
"detail": {
|
||||||
@@ -739,6 +1009,29 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "HTTPValidationError"
|
"title": "HTTPValidationError"
|
||||||
},
|
},
|
||||||
|
"StandardResponse": {
|
||||||
|
"properties": {
|
||||||
|
"status": {
|
||||||
|
"type": "integer",
|
||||||
|
"title": "Status"
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"title": "Response"
|
||||||
|
},
|
||||||
|
"time": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Time"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"status",
|
||||||
|
"response",
|
||||||
|
"time"
|
||||||
|
],
|
||||||
|
"title": "StandardResponse",
|
||||||
|
"description": "标准响应格式"
|
||||||
|
},
|
||||||
"ValidationError": {
|
"ValidationError": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"loc": {
|
"loc": {
|
||||||
|
|||||||
@@ -134,9 +134,9 @@
|
|||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<!-- 主内容区 -->
|
<!-- 主内容区 -->
|
||||||
<main class="flex-1 p-6">
|
<main class="flex-1" style="height: calc(100vh - 0px);">
|
||||||
<!-- 仪表盘页面 -->
|
<!-- 仪表盘页面 -->
|
||||||
<div id="dashboard-page" class="page-content">
|
<div id="dashboard-page" class="page-content hidden" style="padding: 1.5rem; height: 100%; overflow-y: auto;">
|
||||||
<!-- 顶部数据卡片 -->
|
<!-- 顶部数据卡片 -->
|
||||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
|
||||||
<div class="bg-white rounded-xl p-4 card-shadow">
|
<div class="bg-white rounded-xl p-4 card-shadow">
|
||||||
@@ -363,7 +363,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 数据集管理页面 -->
|
<!-- 数据集管理页面 -->
|
||||||
<div id="dataset-page" class="page-content hidden">
|
<div id="dataset-page" class="page-content hidden" style="padding: 1.5rem; height: 100%; overflow-y: auto;">
|
||||||
<div class="bg-white rounded-xl p-6 card-shadow">
|
<div class="bg-white rounded-xl p-6 card-shadow">
|
||||||
<div class="flex justify-between items-center mb-6">
|
<div class="flex justify-between items-center mb-6">
|
||||||
<p class="text-lg font-semibold text-dashboard-text">数据集管理</p>
|
<p class="text-lg font-semibold text-dashboard-text">数据集管理</p>
|
||||||
@@ -380,50 +380,51 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 其他页面占位符 -->
|
<!-- 数据预处理页面 - Easy-Datasets -->
|
||||||
<div id="preprocess-page" class="page-content hidden">
|
<div id="preprocess-page" class="page-content hidden h-full" style="padding: 0;">
|
||||||
<div class="bg-white rounded-xl p-6 card-shadow">
|
<iframe id="easy-datasets-frame"
|
||||||
<p class="text-lg font-semibold text-dashboard-text mb-4">数据预处理</p>
|
src="http://localhost:1717"
|
||||||
<p class="text-dashboard-textLight">数据预处理功能开发中...</p>
|
style="width: 100%; height: 100%; border: none;"
|
||||||
</div>
|
title="Easy-Datasets">
|
||||||
|
</iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="pretrain-page" class="page-content hidden">
|
<div id="pretrain-page" class="page-content hidden" style="padding: 1.5rem; height: 100%; overflow-y: auto;">
|
||||||
<div class="bg-white rounded-xl p-6 card-shadow">
|
<div class="bg-white rounded-xl p-6 card-shadow">
|
||||||
<p class="text-lg font-semibold text-dashboard-text mb-4">模型预训练</p>
|
<p class="text-lg font-semibold text-dashboard-text mb-4">模型预训练</p>
|
||||||
<p class="text-dashboard-textLight">模型预训练功能开发中...</p>
|
<p class="text-dashboard-textLight">模型预训练功能开发中...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="finetune-page" class="page-content hidden">
|
<div id="finetune-page" class="page-content hidden" style="padding: 1.5rem; height: 100%; overflow-y: auto;">
|
||||||
<div class="bg-white rounded-xl p-6 card-shadow">
|
<div class="bg-white rounded-xl p-6 card-shadow">
|
||||||
<p class="text-lg font-semibold text-dashboard-text mb-4">模型微调</p>
|
<p class="text-lg font-semibold text-dashboard-text mb-4">模型微调</p>
|
||||||
<p class="text-dashboard-textLight">模型微调功能开发中...</p>
|
<p class="text-dashboard-textLight">模型微调功能开发中...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="rl-page" class="page-content hidden">
|
<div id="rl-page" class="page-content hidden" style="padding: 1.5rem; height: 100%; overflow-y: auto;">
|
||||||
<div class="bg-white rounded-xl p-6 card-shadow">
|
<div class="bg-white rounded-xl p-6 card-shadow">
|
||||||
<p class="text-lg font-semibold text-dashboard-text mb-4">强化训练</p>
|
<p class="text-lg font-semibold text-dashboard-text mb-4">强化训练</p>
|
||||||
<p class="text-dashboard-textLight">强化训练功能开发中...</p>
|
<p class="text-dashboard-textLight">强化训练功能开发中...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="validate-page" class="page-content hidden">
|
<div id="validate-page" class="page-content hidden" style="padding: 1.5rem; height: 100%; overflow-y: auto;">
|
||||||
<div class="bg-white rounded-xl p-6 card-shadow">
|
<div class="bg-white rounded-xl p-6 card-shadow">
|
||||||
<p class="text-lg font-semibold text-dashboard-text mb-4">模型验证</p>
|
<p class="text-lg font-semibold text-dashboard-text mb-4">模型验证</p>
|
||||||
<p class="text-dashboard-textLight">模型验证功能开发中...</p>
|
<p class="text-dashboard-textLight">模型验证功能开发中...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="compare-page" class="page-content hidden">
|
<div id="compare-page" class="page-content hidden" style="padding: 1.5rem; height: 100%; overflow-y: auto;">
|
||||||
<div class="bg-white rounded-xl p-6 card-shadow">
|
<div class="bg-white rounded-xl p-6 card-shadow">
|
||||||
<p class="text-lg font-semibold text-dashboard-text mb-4">模型对比</p>
|
<p class="text-lg font-semibold text-dashboard-text mb-4">模型对比</p>
|
||||||
<p class="text-dashboard-textLight">模型对比功能开发中...</p>
|
<p class="text-dashboard-textLight">模型对比功能开发中...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="config-page" class="page-content hidden">
|
<div id="config-page" class="page-content hidden" style="padding: 1.5rem; height: 100%; overflow-y: auto;">
|
||||||
<div class="bg-white rounded-xl p-6 card-shadow">
|
<div class="bg-white rounded-xl p-6 card-shadow">
|
||||||
<p class="text-lg font-semibold text-dashboard-text mb-4">模型配置</p>
|
<p class="text-lg font-semibold text-dashboard-text mb-4">模型配置</p>
|
||||||
<p class="text-dashboard-textLight">模型配置功能开发中...</p>
|
<p class="text-dashboard-textLight">模型配置功能开发中...</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user