intellif-aihub 0.1.21__py3-none-any.whl → 0.1.23__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of intellif-aihub might be problematic. Click here for more details.
- aihub/__init__.py +1 -1
- aihub/cli/__init__.py +1 -0
- aihub/cli/__main__.py +8 -0
- aihub/cli/config.py +136 -0
- aihub/cli/main.py +295 -0
- aihub/cli/model_center.py +355 -0
- aihub/models/eval.py +31 -0
- aihub/models/model_center.py +80 -111
- aihub/models/task_center.py +1 -0
- aihub/models/user_system.py +1 -1
- aihub/services/eval.py +59 -9
- aihub/services/model_center.py +202 -54
- aihub/services/task_center.py +3 -0
- aihub/services/user_system.py +26 -9
- aihub/utils/s3.py +49 -6
- {intellif_aihub-0.1.21.dist-info → intellif_aihub-0.1.23.dist-info}/METADATA +2 -1
- {intellif_aihub-0.1.21.dist-info → intellif_aihub-0.1.23.dist-info}/RECORD +21 -15
- intellif_aihub-0.1.23.dist-info/entry_points.txt +2 -0
- {intellif_aihub-0.1.21.dist-info → intellif_aihub-0.1.23.dist-info}/WHEEL +0 -0
- {intellif_aihub-0.1.21.dist-info → intellif_aihub-0.1.23.dist-info}/licenses/LICENSE +0 -0
- {intellif_aihub-0.1.21.dist-info → intellif_aihub-0.1.23.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""模型中心 CLI 命令模块"""
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Optional
|
|
6
|
+
|
|
7
|
+
import typer
|
|
8
|
+
from rich.console import Console
|
|
9
|
+
from rich.progress import Progress, SpinnerColumn, TextColumn
|
|
10
|
+
from rich.table import Table
|
|
11
|
+
|
|
12
|
+
from ..models.model_center import (
|
|
13
|
+
ListModelsRequest,
|
|
14
|
+
CreateModelRequest,
|
|
15
|
+
EditModelRequest,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
console = Console()
|
|
19
|
+
|
|
20
|
+
# 创建模型中心子应用
|
|
21
|
+
model_app = typer.Typer(
|
|
22
|
+
name="model",
|
|
23
|
+
help="模型中心相关命令",
|
|
24
|
+
no_args_is_help=True,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@model_app.command("list")
|
|
29
|
+
def list_models(
|
|
30
|
+
page_size: int = typer.Option(20, "--page-size", "-s", help="每页显示数量"),
|
|
31
|
+
page_num: int = typer.Option(1, "--page", "-p", help="页码"),
|
|
32
|
+
name: Optional[str] = typer.Option(None, "--name", "-n", help="按名称过滤"),
|
|
33
|
+
tags: Optional[str] = typer.Option(None, "--tags", "-t", help="按标签过滤"),
|
|
34
|
+
model_ids: Optional[str] = typer.Option(None, "--ids", help="按模型ID过滤(逗号分隔)"),
|
|
35
|
+
):
|
|
36
|
+
"""列出模型"""
|
|
37
|
+
from .main import get_client
|
|
38
|
+
|
|
39
|
+
try:
|
|
40
|
+
client = get_client()
|
|
41
|
+
|
|
42
|
+
with Progress(
|
|
43
|
+
SpinnerColumn(),
|
|
44
|
+
TextColumn("[progress.description]{task.description}"),
|
|
45
|
+
console=console,
|
|
46
|
+
) as progress:
|
|
47
|
+
task = progress.add_task("正在获取模型列表...", total=None)
|
|
48
|
+
|
|
49
|
+
request = ListModelsRequest(
|
|
50
|
+
page_size=page_size,
|
|
51
|
+
page_num=page_num,
|
|
52
|
+
name=name,
|
|
53
|
+
tags=tags,
|
|
54
|
+
model_ids=model_ids,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
response = client.model_center.list_models(request)
|
|
58
|
+
progress.remove_task(task)
|
|
59
|
+
|
|
60
|
+
if not response.data:
|
|
61
|
+
console.print("📭 没有找到模型")
|
|
62
|
+
return
|
|
63
|
+
|
|
64
|
+
# 创建表格显示结果
|
|
65
|
+
table = Table(title=f"模型列表 (第 {page_num} 页,共 {response.total} 个)")
|
|
66
|
+
table.add_column("ID", style="cyan", no_wrap=True)
|
|
67
|
+
table.add_column("名称", style="magenta")
|
|
68
|
+
table.add_column("描述", style="green")
|
|
69
|
+
table.add_column("公开", style="blue")
|
|
70
|
+
|
|
71
|
+
for model in response.data:
|
|
72
|
+
table.add_row(
|
|
73
|
+
str(model.id),
|
|
74
|
+
model.name,
|
|
75
|
+
model.description or "-",
|
|
76
|
+
"是" if model.is_public else "否",
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
console.print(table)
|
|
80
|
+
|
|
81
|
+
# 显示分页信息
|
|
82
|
+
total_pages = (response.total + page_size - 1) // page_size
|
|
83
|
+
console.print(f"\n📄 第 {page_num}/{total_pages} 页,共 {response.total} 个模型")
|
|
84
|
+
|
|
85
|
+
except Exception as e:
|
|
86
|
+
console.print(f"❌ 获取模型列表失败: {e}", style="red")
|
|
87
|
+
raise typer.Exit(1)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@model_app.command("get")
|
|
91
|
+
def get_model(
|
|
92
|
+
model_id: int = typer.Argument(..., help="模型ID"),
|
|
93
|
+
):
|
|
94
|
+
"""获取模型详情"""
|
|
95
|
+
from .main import get_client
|
|
96
|
+
|
|
97
|
+
try:
|
|
98
|
+
client = get_client()
|
|
99
|
+
|
|
100
|
+
with Progress(
|
|
101
|
+
SpinnerColumn(),
|
|
102
|
+
TextColumn("[progress.description]{task.description}"),
|
|
103
|
+
console=console,
|
|
104
|
+
) as progress:
|
|
105
|
+
task = progress.add_task(f"正在获取模型 {model_id} 详情...", total=None)
|
|
106
|
+
model = client.model_center.get_model(model_id)
|
|
107
|
+
progress.remove_task(task)
|
|
108
|
+
|
|
109
|
+
# 显示模型详情
|
|
110
|
+
console.print(f"\n🤖 [bold]模型详情[/bold]")
|
|
111
|
+
console.print(f"ID: {model.id}")
|
|
112
|
+
console.print(f"名称: {model.name}")
|
|
113
|
+
console.print(f"描述: {model.description or '无'}")
|
|
114
|
+
console.print(f"标签: {model.tags or '无'}")
|
|
115
|
+
console.print(f"公开: {'是' if model.is_public else '否'}")
|
|
116
|
+
console.print(f"创建时间: {'_' if model.created_at else '未知'}")
|
|
117
|
+
|
|
118
|
+
if model.readme_content:
|
|
119
|
+
console.print(f"\n📖 [bold]README:[/bold]")
|
|
120
|
+
console.print(model.readme_content[:500] + ("..." if len(model.readme_content) > 500 else ""))
|
|
121
|
+
|
|
122
|
+
except Exception as e:
|
|
123
|
+
console.print(f"❌ 获取模型详情失败: {e}", style="red")
|
|
124
|
+
raise typer.Exit(1)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
@model_app.command("create")
|
|
128
|
+
def create_model(
|
|
129
|
+
name: str = typer.Argument(..., help="模型名称"),
|
|
130
|
+
description: Optional[str] = typer.Option(None, "--description", "-d", help="模型描述"),
|
|
131
|
+
tags: Optional[str] = typer.Option(None, "--tags", "-t", help="模型标签"),
|
|
132
|
+
public: bool = typer.Option(True, "--public/--private", help="是否公开"),
|
|
133
|
+
readme: Optional[str] = typer.Option(None, "--readme", "-r", help="README 内容"),
|
|
134
|
+
):
|
|
135
|
+
"""创建模型"""
|
|
136
|
+
from .main import get_client
|
|
137
|
+
|
|
138
|
+
try:
|
|
139
|
+
client = get_client()
|
|
140
|
+
|
|
141
|
+
with Progress(
|
|
142
|
+
SpinnerColumn(),
|
|
143
|
+
TextColumn("[progress.description]{task.description}"),
|
|
144
|
+
console=console,
|
|
145
|
+
) as progress:
|
|
146
|
+
task = progress.add_task(f"正在创建模型 '{name}'...", total=None)
|
|
147
|
+
|
|
148
|
+
request = CreateModelRequest(
|
|
149
|
+
name=name,
|
|
150
|
+
description=description,
|
|
151
|
+
tags=tags,
|
|
152
|
+
is_public=public,
|
|
153
|
+
readme_content=readme,
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
model_id = client.model_center.create_model(request)
|
|
157
|
+
progress.remove_task(task)
|
|
158
|
+
|
|
159
|
+
console.print(f"✅ 模型创建成功!")
|
|
160
|
+
console.print(f"模型ID: {model_id}")
|
|
161
|
+
console.print(f"名称: {name}")
|
|
162
|
+
|
|
163
|
+
except Exception as e:
|
|
164
|
+
console.print(f"❌ 创建模型失败: {e}", style="red")
|
|
165
|
+
raise typer.Exit(1)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
@model_app.command("edit")
|
|
169
|
+
def edit_model(
|
|
170
|
+
model_id: int = typer.Argument(..., help="模型ID"),
|
|
171
|
+
name: Optional[str] = typer.Option(None, "--name", "-n", help="新的模型名称"),
|
|
172
|
+
description: Optional[str] = typer.Option(None, "--description", "-d", help="新的模型描述"),
|
|
173
|
+
public: Optional[bool] = typer.Option(None, "--public/--private", help="是否公开"),
|
|
174
|
+
):
|
|
175
|
+
"""编辑模型信息"""
|
|
176
|
+
from .main import get_client
|
|
177
|
+
|
|
178
|
+
try:
|
|
179
|
+
client = get_client()
|
|
180
|
+
|
|
181
|
+
with Progress(
|
|
182
|
+
SpinnerColumn(),
|
|
183
|
+
TextColumn("[progress.description]{task.description}"),
|
|
184
|
+
console=console,
|
|
185
|
+
) as progress:
|
|
186
|
+
task = progress.add_task(f"正在编辑模型 {model_id}...", total=None)
|
|
187
|
+
|
|
188
|
+
request = EditModelRequest(
|
|
189
|
+
name=name,
|
|
190
|
+
description=description,
|
|
191
|
+
is_public=public,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
client.model_center.edit_model(model_id, request)
|
|
195
|
+
progress.remove_task(task)
|
|
196
|
+
|
|
197
|
+
console.print(f"✅ 模型 {model_id} 编辑成功!")
|
|
198
|
+
|
|
199
|
+
except Exception as e:
|
|
200
|
+
console.print(f"❌ 编辑模型失败: {e}", style="red")
|
|
201
|
+
raise typer.Exit(1)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
@model_app.command("delete")
|
|
205
|
+
def delete_model(
|
|
206
|
+
model_id: int = typer.Argument(..., help="模型ID"),
|
|
207
|
+
force: bool = typer.Option(False, "--force", "-f", help="强制删除,不询问确认"),
|
|
208
|
+
):
|
|
209
|
+
"""删除模型"""
|
|
210
|
+
from .main import get_client
|
|
211
|
+
|
|
212
|
+
if not force:
|
|
213
|
+
confirm = typer.confirm(f"确定要删除模型 {model_id} 吗?此操作不可撤销!")
|
|
214
|
+
if not confirm:
|
|
215
|
+
console.print("❌ 操作已取消")
|
|
216
|
+
return
|
|
217
|
+
|
|
218
|
+
try:
|
|
219
|
+
client = get_client()
|
|
220
|
+
|
|
221
|
+
with Progress(
|
|
222
|
+
SpinnerColumn(),
|
|
223
|
+
TextColumn("[progress.description]{task.description}"),
|
|
224
|
+
console=console,
|
|
225
|
+
) as progress:
|
|
226
|
+
task = progress.add_task(f"正在删除模型 {model_id}...", total=None)
|
|
227
|
+
client.model_center.delete_model(model_id)
|
|
228
|
+
progress.remove_task(task)
|
|
229
|
+
|
|
230
|
+
console.print(f"✅ 模型 {model_id} 删除成功!")
|
|
231
|
+
|
|
232
|
+
except Exception as e:
|
|
233
|
+
console.print(f"❌ 删除模型失败: {e}", style="red")
|
|
234
|
+
raise typer.Exit(1)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
@model_app.command("upload")
|
|
238
|
+
def upload_model(
|
|
239
|
+
local_dir: str = typer.Argument(..., help="本地模型目录路径"),
|
|
240
|
+
model_id: Optional[int] = typer.Option(None, "--model-id", help="模型ID"),
|
|
241
|
+
model_name: Optional[str] = typer.Option(None, "--model-name", help="模型名称"),
|
|
242
|
+
timeout: int = typer.Option(3600, "--timeout", help="上传超时时间(秒)"),
|
|
243
|
+
):
|
|
244
|
+
"""上传模型文件"""
|
|
245
|
+
from .main import get_client
|
|
246
|
+
|
|
247
|
+
# 验证参数
|
|
248
|
+
if not model_id and not model_name:
|
|
249
|
+
console.print("❌ 必须提供 --model-id 或 --model-name 参数", style="red")
|
|
250
|
+
raise typer.Exit(1)
|
|
251
|
+
|
|
252
|
+
local_path = Path(local_dir)
|
|
253
|
+
if not local_path.exists():
|
|
254
|
+
console.print(f"❌ 本地目录不存在: {local_dir}", style="red")
|
|
255
|
+
raise typer.Exit(1)
|
|
256
|
+
|
|
257
|
+
try:
|
|
258
|
+
client = get_client()
|
|
259
|
+
|
|
260
|
+
console.print(f"🚀 开始上传模型...")
|
|
261
|
+
console.print(f"本地目录: {local_dir}")
|
|
262
|
+
if model_id:
|
|
263
|
+
console.print(f"目标模型ID: {model_id}")
|
|
264
|
+
if model_name:
|
|
265
|
+
console.print(f"目标模型名称: {model_name}")
|
|
266
|
+
|
|
267
|
+
client.model_center.upload(
|
|
268
|
+
local_dir=str(local_path),
|
|
269
|
+
model_id=model_id,
|
|
270
|
+
model_name=model_name,
|
|
271
|
+
timeout_seconds=timeout,
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
console.print("✅ 模型上传成功!")
|
|
275
|
+
|
|
276
|
+
except Exception as e:
|
|
277
|
+
console.print(f"❌ 上传模型失败: {e}", style="red")
|
|
278
|
+
raise typer.Exit(1)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
@model_app.command("download")
|
|
282
|
+
def download_model(
|
|
283
|
+
local_dir: str = typer.Argument(..., help="下载到的本地目录路径"),
|
|
284
|
+
model_id: Optional[int] = typer.Option(None, "--model-id", help="模型ID"),
|
|
285
|
+
model_name: Optional[str] = typer.Option(None, "--model-name", help="模型名称"),
|
|
286
|
+
):
|
|
287
|
+
"""下载模型文件"""
|
|
288
|
+
from .main import get_client
|
|
289
|
+
|
|
290
|
+
# 验证参数
|
|
291
|
+
if not model_id and not model_name:
|
|
292
|
+
console.print("❌ 必须提供 --model-id 或 --model-name 参数", style="red")
|
|
293
|
+
raise typer.Exit(1)
|
|
294
|
+
|
|
295
|
+
try:
|
|
296
|
+
client = get_client()
|
|
297
|
+
|
|
298
|
+
console.print(f"📥 开始下载模型...")
|
|
299
|
+
if model_id:
|
|
300
|
+
console.print(f"模型ID: {model_id}")
|
|
301
|
+
if model_name:
|
|
302
|
+
console.print(f"模型名称: {model_name}")
|
|
303
|
+
console.print(f"下载目录: {local_dir}")
|
|
304
|
+
|
|
305
|
+
client.model_center.download(
|
|
306
|
+
local_dir=local_dir,
|
|
307
|
+
model_id=model_id,
|
|
308
|
+
model_name=model_name,
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
console.print("✅ 模型下载成功!")
|
|
312
|
+
|
|
313
|
+
except Exception as e:
|
|
314
|
+
console.print(f"❌ 下载模型失败: {e}", style="red")
|
|
315
|
+
raise typer.Exit(1)
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
@model_app.command("info")
|
|
319
|
+
def model_info(
|
|
320
|
+
model_id: Optional[int] = typer.Option(None, "--model-id", help="模型ID"),
|
|
321
|
+
model_name: Optional[str] = typer.Option(None, "--model-name", help="模型名称"),
|
|
322
|
+
):
|
|
323
|
+
"""获取模型数据库信息"""
|
|
324
|
+
from .main import get_client
|
|
325
|
+
|
|
326
|
+
# 验证参数
|
|
327
|
+
if not model_id and not model_name:
|
|
328
|
+
console.print("❌ 必须提供 --model-id 或 --model-name 参数", style="red")
|
|
329
|
+
raise typer.Exit(1)
|
|
330
|
+
|
|
331
|
+
try:
|
|
332
|
+
client = get_client()
|
|
333
|
+
|
|
334
|
+
with Progress(
|
|
335
|
+
SpinnerColumn(),
|
|
336
|
+
TextColumn("[progress.description]{task.description}"),
|
|
337
|
+
console=console,
|
|
338
|
+
) as progress:
|
|
339
|
+
task = progress.add_task("正在获取模型信息...", total=None)
|
|
340
|
+
model_db = client.model_center.get_model_db(id=model_id, name=model_name)
|
|
341
|
+
progress.remove_task(task)
|
|
342
|
+
|
|
343
|
+
# 显示模型数据库信息
|
|
344
|
+
console.print(f"\n🗄️ [bold]模型数据库信息[/bold]")
|
|
345
|
+
console.print(f"ID: {model_db.id}")
|
|
346
|
+
console.print(f"名称: {model_db.name}")
|
|
347
|
+
console.print(f"状态: {model_db.status}")
|
|
348
|
+
console.print(f"对象存储路径: {model_db.object_storage_path or '无'}")
|
|
349
|
+
console.print(f"CSV文件路径: {model_db.csv_file_path or '无'}")
|
|
350
|
+
console.print(f"Parquet索引路径: {model_db.parquet_index_path or '无'}")
|
|
351
|
+
console.print(f"任务状态S3路径: {model_db.task_status_s3_path or '无'}")
|
|
352
|
+
|
|
353
|
+
except Exception as e:
|
|
354
|
+
console.print(f"❌ 获取模型信息失败: {e}", style="red")
|
|
355
|
+
raise typer.Exit(1)
|
aihub/models/eval.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# !/usr/bin/env python
|
|
2
2
|
# -*-coding:utf-8 -*-
|
|
3
|
+
from enum import Enum
|
|
3
4
|
from typing import Dict, List, Optional
|
|
4
5
|
|
|
5
6
|
from pydantic import BaseModel, Field
|
|
@@ -7,30 +8,47 @@ from pydantic import BaseModel, Field
|
|
|
7
8
|
|
|
8
9
|
class BaseEvalReq(BaseModel):
|
|
9
10
|
"""评测任务基础请求模型"""
|
|
11
|
+
|
|
10
12
|
run_id: str = Field(description="运行ID")
|
|
11
13
|
type: str = Field(description="评测类型,支持 'llm' 和 'cv'")
|
|
12
14
|
prediction_artifact_path: str = Field(description="推理产物的路径")
|
|
13
15
|
user_id: int = Field(0, description="用户ID,默认0")
|
|
14
16
|
|
|
15
17
|
|
|
18
|
+
class ClientType(Enum):
|
|
19
|
+
"""客户端类型枚举"""
|
|
20
|
+
|
|
21
|
+
Workflow = "workflow"
|
|
22
|
+
sdk = "sdk"
|
|
23
|
+
|
|
24
|
+
|
|
16
25
|
class CreateLLMEvalReq(BaseEvalReq):
|
|
17
26
|
"""创建LLM类型评测任务请求"""
|
|
27
|
+
|
|
18
28
|
type: str = Field(default="llm", description="评测类型,固定为 'llm'")
|
|
19
29
|
dataset_id: int = Field(description="数据集ID")
|
|
20
30
|
dataset_version_id: int = Field(description="数据集版本ID")
|
|
21
31
|
evaled_artifact_path: str = Field(description="评测结果产物的路径")
|
|
22
32
|
report: Dict = Field(description="评测报告")
|
|
33
|
+
is_public: bool = Field(default=False, description="是否公开")
|
|
34
|
+
client_type: ClientType = Field(default=ClientType.Workflow, description="客户端类型")
|
|
35
|
+
model_config = {"use_enum_values": True}
|
|
23
36
|
|
|
24
37
|
|
|
25
38
|
class CreateCVEvalReq(BaseEvalReq):
|
|
26
39
|
"""创建CV类型评测任务请求"""
|
|
40
|
+
|
|
27
41
|
type: str = Field(default="cv", description="评测类型,固定为 'cv'")
|
|
28
42
|
metrics_artifact_path: str = Field(description="指标产物的路径")
|
|
29
43
|
ground_truth_artifact_path: str = Field(description="真实标签产物的路径")
|
|
44
|
+
is_public: bool = Field(default=False, description="是否公开")
|
|
45
|
+
client_type: ClientType = Field(default=ClientType.Workflow, description="客户端类型")
|
|
46
|
+
model_config = {"use_enum_values": True}
|
|
30
47
|
|
|
31
48
|
|
|
32
49
|
class EvalRun(BaseModel):
|
|
33
50
|
"""评测任务的运行实体"""
|
|
51
|
+
|
|
34
52
|
id: int = Field(description="评测的运行ID")
|
|
35
53
|
name: str = Field(description="评测名称")
|
|
36
54
|
description: str = Field(description="评测描述")
|
|
@@ -50,15 +68,20 @@ class EvalRun(BaseModel):
|
|
|
50
68
|
eval_config: Optional[Dict] = Field(default=None, description="评测配置")
|
|
51
69
|
created_at: int = Field(description="创建时间")
|
|
52
70
|
updated_at: int = Field(description="更新时间")
|
|
71
|
+
is_public: bool = Field(default=False, description="是否公开")
|
|
72
|
+
client_type: ClientType = Field(default=ClientType.Workflow, description="客户端类型")
|
|
73
|
+
model_config = {"use_enum_values": True, "protected_namespaces": ()}
|
|
53
74
|
|
|
54
75
|
|
|
55
76
|
class CreateEvalResp(BaseModel):
|
|
56
77
|
"""创建评测任务的返回结果"""
|
|
78
|
+
|
|
57
79
|
eval_run: EvalRun = Field(alias="eval_run", description="评测运行信息")
|
|
58
80
|
|
|
59
81
|
|
|
60
82
|
class ListEvalReq(BaseModel):
|
|
61
83
|
"""列出评测任务请求"""
|
|
84
|
+
|
|
62
85
|
page_size: int = Field(20, description="页面大小")
|
|
63
86
|
page_num: int = Field(1, description="页码")
|
|
64
87
|
status: Optional[str] = Field(None, description="状态过滤")
|
|
@@ -71,11 +94,19 @@ class ListEvalReq(BaseModel):
|
|
|
71
94
|
model_ids: Optional[str] = Field(None, description="模型ID列表过滤")
|
|
72
95
|
dataset_ids: Optional[str] = Field(None, description="数据集ID列表过滤")
|
|
73
96
|
dataset_version_ids: Optional[str] = Field(None, description="数据集版本ID列表过滤")
|
|
97
|
+
model_config = {"use_enum_values": True, "protected_namespaces": ()}
|
|
74
98
|
|
|
75
99
|
|
|
76
100
|
class ListEvalResp(BaseModel):
|
|
77
101
|
"""列出评测任务响应"""
|
|
102
|
+
|
|
78
103
|
total: int = Field(description="总数")
|
|
79
104
|
page_size: int = Field(description="页面大小")
|
|
80
105
|
page_num: int = Field(description="页码")
|
|
81
106
|
data: List[EvalRun] = Field(description="评测运行列表")
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class GrantPermissionReq(BaseModel):
|
|
110
|
+
"""授权权限请求"""
|
|
111
|
+
|
|
112
|
+
user_ids: list[int] = Field(description="用户ID数组")
|