intellif-aihub 0.1.4__py3-none-any.whl → 0.1.6__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.

Files changed (35) hide show
  1. aihub/__init__.py +1 -1
  2. aihub/client.py +35 -12
  3. aihub/models/artifact.py +1 -1
  4. aihub/models/data_warehouse.py +95 -0
  5. aihub/models/dataset_management.py +99 -61
  6. aihub/models/document_center.py +26 -18
  7. aihub/models/eval.py +20 -11
  8. aihub/models/labelfree.py +12 -38
  9. aihub/models/model_center.py +141 -0
  10. aihub/models/model_training_platform.py +183 -149
  11. aihub/models/quota_schedule_management.py +201 -150
  12. aihub/models/tag_resource_management.py +30 -24
  13. aihub/models/task_center.py +39 -36
  14. aihub/models/user_system.py +159 -125
  15. aihub/models/workflow_center.py +461 -0
  16. aihub/services/artifact.py +22 -15
  17. aihub/services/data_warehouse.py +97 -0
  18. aihub/services/dataset_management.py +142 -23
  19. aihub/services/document_center.py +24 -5
  20. aihub/services/eval.py +14 -7
  21. aihub/services/labelfree.py +11 -0
  22. aihub/services/model_center.py +183 -0
  23. aihub/services/model_training_platform.py +99 -29
  24. aihub/services/quota_schedule_management.py +104 -7
  25. aihub/services/tag_resource_management.py +33 -2
  26. aihub/services/task_center.py +23 -9
  27. aihub/services/user_system.py +237 -2
  28. aihub/services/workflow_center.py +522 -0
  29. aihub/utils/download.py +19 -3
  30. {intellif_aihub-0.1.4.dist-info → intellif_aihub-0.1.6.dist-info}/METADATA +3 -3
  31. intellif_aihub-0.1.6.dist-info/RECORD +42 -0
  32. intellif_aihub-0.1.4.dist-info/RECORD +0 -36
  33. {intellif_aihub-0.1.4.dist-info → intellif_aihub-0.1.6.dist-info}/WHEEL +0 -0
  34. {intellif_aihub-0.1.4.dist-info → intellif_aihub-0.1.6.dist-info}/licenses/LICENSE +0 -0
  35. {intellif_aihub-0.1.4.dist-info → intellif_aihub-0.1.6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,522 @@
1
+ # !/usr/bin/env python
2
+ # -*- coding:utf-8 -*-
3
+ """
4
+ 工作流中心服务模块
5
+
6
+ 封装 **Workflow‑Center** 相关接口,围绕三大核心资源展开:
7
+
8
+ - **Pipeline** – *工作流定义*
9
+
10
+ - 列表
11
+ - 创建
12
+ - 删除
13
+ - 下拉选择
14
+ - 创建者
15
+
16
+ - **Pipeline Version** – *工作流版本*
17
+
18
+ - 列表
19
+ - 创建
20
+ - 删除
21
+ - 输入参数查询
22
+ - 批量迁移
23
+
24
+ - **Run** – *运行实例*
25
+
26
+ - 创建
27
+ - 重试
28
+ - 停止
29
+ - 重新提交
30
+ - 日志查询
31
+ - Pod 查询
32
+ - 事件查询
33
+ - 运行用户
34
+ """
35
+
36
+ from __future__ import annotations
37
+
38
+ from typing import List
39
+
40
+ import httpx
41
+
42
+ from ..exceptions import APIError
43
+ from ..models.common import APIWrapper
44
+ from ..models.workflow_center import (
45
+ ListPipelinesRequest,
46
+ ListPipelinesResponse,
47
+ CreatePipelineRequest,
48
+ CreatePipelineResponse,
49
+ Pipeline,
50
+ PipelineBrief,
51
+ SelectPipelinesRequest,
52
+ SelectPipelinesResponse,
53
+ PipelineUserBrief,
54
+ SelectPipelineUsersResponse,
55
+ ListPipelineVersionsRequest,
56
+ ListPipelineVersionsResponse,
57
+ CreatePipelineVersionRequest,
58
+ CreatePipelineVersionResponse,
59
+ PipelineVersion,
60
+ PipelineVersionBrief,
61
+ SelectPipelineVersionsRequest,
62
+ SelectPipelineVersionsResponse,
63
+ GetPipelineVersionInputParamsResponse,
64
+ MigratePipelineVersionsRequest,
65
+ ListRunsRequest,
66
+ ListRunsResponse,
67
+ CreateRunRequest,
68
+ CreateRunResponse,
69
+ Run,
70
+ RetryRunResponse,
71
+ StopRunResponse,
72
+ ResubmitRunResponse,
73
+ GetRunTaskLogsResponse,
74
+ GetRunTaskPodResponse,
75
+ GetRunTaskEventsResponse,
76
+ RunUserBrief,
77
+ SelectRunUsersResponse,
78
+ )
79
+
80
+ _BASE = "/workflow-center/api/v1"
81
+
82
+
83
+ class WorkflowCenterService:
84
+ """工作流中心服务"""
85
+
86
+ def __init__(self, http: httpx.Client):
87
+ self._pipeline = _Pipeline(http)
88
+ self._pipeline_version = _PipelineVersion(http)
89
+ self._run = _Run(http)
90
+
91
+ def list_pipelines(self, payload: ListPipelinesRequest) -> ListPipelinesResponse:
92
+ """分页查询工作流列表
93
+
94
+ Args:
95
+ payload: 分页 + 过滤条件,请参见 ``ListPipelinesRequest``
96
+
97
+ Returns:
98
+ ListPipelinesResponse: 分页结果
99
+ """
100
+ return self._pipeline.list(payload)
101
+
102
+ def get_pipeline(self, pipeline_id: int) -> Pipeline:
103
+ """获取单个工作流详情
104
+
105
+ Args:
106
+ pipeline_id: 工作流 ID
107
+
108
+ Returns:
109
+ Pipeline: 工作流完整信息
110
+ """
111
+ return self._pipeline.get(pipeline_id)
112
+
113
+ def create_pipeline(self, payload: CreatePipelineRequest) -> int:
114
+ """创建工作流
115
+
116
+ Args:
117
+ payload: 创建请求体,包含节点 / 输入等
118
+
119
+ Returns:
120
+ int: 新建工作流 ID
121
+ """
122
+ return self._pipeline.create(payload)
123
+
124
+ def delete_pipeline(self, pipeline_id: int) -> None:
125
+ """删除工作流
126
+
127
+ Args:
128
+ pipeline_id: 目标工作流 ID
129
+ """
130
+ self._pipeline.delete(pipeline_id)
131
+
132
+ def select_pipelines(self, name: str | None = None) -> List[PipelineBrief]:
133
+ """下拉搜索工作流
134
+
135
+ Args:
136
+ name: 名称关键字(可选)
137
+
138
+ Returns:
139
+ list[PipelineBrief]: 简要信息列表
140
+ """
141
+ return self._pipeline.select(SelectPipelinesRequest(name=name)).data
142
+
143
+ def select_pipeline_users(self) -> List[PipelineUserBrief]:
144
+ """获取创建工作流的用户列表
145
+
146
+ Returns:
147
+ list[PipelineUserBrief]: 用户简要信息
148
+ """
149
+ return self._pipeline.select_users().data
150
+
151
+ def list_pipeline_versions(self, payload: ListPipelineVersionsRequest) -> ListPipelineVersionsResponse:
152
+ """分页查询工作流版本
153
+
154
+ Args:
155
+ payload: 分页 + 过滤条件
156
+
157
+ Returns:
158
+ ListPipelineVersionsResponse: 分页结果
159
+ """
160
+ return self._pipeline_version.list(payload)
161
+
162
+ def get_pipeline_version(self, version_id: int) -> PipelineVersion:
163
+ """获取工作流版本详情
164
+
165
+ Args:
166
+ version_id: 版本 ID
167
+
168
+ Returns:
169
+ PipelineVersion: 版本详细信息
170
+ """
171
+ return self._pipeline_version.get(version_id)
172
+
173
+ def create_pipeline_version(self, payload: CreatePipelineVersionRequest) -> int:
174
+ """创建工作流版本
175
+
176
+ Args:
177
+ payload: 创建请求体
178
+
179
+ Returns:
180
+ int: 新建版本 ID
181
+ """
182
+ return self._pipeline_version.create(payload)
183
+
184
+ def delete_pipeline_version(self, version_id: int) -> None:
185
+ """删除工作流版本
186
+
187
+ Args:
188
+ version_id: 目标版本 ID
189
+ """
190
+ self._pipeline_version.delete(version_id)
191
+
192
+ def select_pipeline_versions(self, payload: SelectPipelineVersionsRequest) -> List[PipelineVersionBrief]:
193
+ """下拉搜索工作流版本
194
+
195
+ Args:
196
+ payload: 过滤条件
197
+
198
+ Returns:
199
+ list[PipelineVersionBrief]: 版本简要列表
200
+ """
201
+ return self._pipeline_version.select(payload).data
202
+
203
+ def get_pipeline_version_input_params(self, version_id: int) -> list[str]:
204
+ """获取指定版本的输入参数
205
+
206
+ Args:
207
+ version_id: 版本 ID
208
+
209
+ Returns:
210
+ list[str]: 输入参数名列表
211
+ """
212
+ return self._pipeline_version.get_input_params(version_id).data
213
+
214
+ def migrate_pipeline_versions(self, payload: MigratePipelineVersionsRequest) -> None:
215
+ """批量迁移工作流版本
216
+
217
+ Args:
218
+ payload: 起止版本 ID 等迁移参数
219
+
220
+ Returns:
221
+ None
222
+ """
223
+ self._pipeline_version.migrate(payload)
224
+
225
+ def list_runs(self, payload: ListRunsRequest) -> ListRunsResponse:
226
+ """分页检索运行实例
227
+
228
+ Args:
229
+ payload: 分页与过滤条件
230
+
231
+ Returns:
232
+ ListRunsResponse: 运行实例分页结果
233
+ """
234
+ return self._run.list_runs(payload)
235
+
236
+ def get_run(self, run_id: int) -> Run:
237
+ """获取单次运行详情
238
+
239
+ Args:
240
+ run_id: Run ID
241
+
242
+ Returns:
243
+ Run: 运行完整信息
244
+ """
245
+ return self._run.get_run(run_id)
246
+
247
+ def create_run(self, payload: CreateRunRequest) -> int:
248
+ """创建新的运行实例
249
+
250
+ Args:
251
+ payload: 运行提交参数
252
+
253
+ Returns:
254
+ int: 新建 Run ID
255
+ """
256
+ return self._run.create_run(payload)
257
+
258
+ def retry_run(self, run_id: int) -> Run:
259
+ """重试指定运行
260
+
261
+ Args:
262
+ run_id: 待重试的 Run ID
263
+
264
+ Returns:
265
+ Run: 新生成的运行实例
266
+ """
267
+ return self._run.retry_run(run_id)
268
+
269
+ def stop_run(self, run_id: int) -> Run:
270
+ """停止正在执行的运行
271
+
272
+ Args:
273
+ run_id: 目标 Run ID
274
+
275
+ Returns:
276
+ Run: 已停止的运行信息
277
+ """
278
+ return self._run.stop_run(run_id)
279
+
280
+ def resubmit_run(self, run_id: int) -> Run:
281
+ """复制参数重新提交一次运行
282
+
283
+ Args:
284
+ run_id: 原始 Run ID
285
+
286
+ Returns:
287
+ Run: 新的运行实例
288
+ """
289
+ return self._run.resubmit_run(run_id)
290
+
291
+ def get_run_task_logs(self, run_id: int, pod_name: str) -> GetRunTaskLogsResponse:
292
+ """获取某 Task‑Pod 的日志
293
+
294
+ Args:
295
+ run_id: Run ID
296
+ pod_name: Pod 名称
297
+
298
+ Returns:
299
+ GetRunTaskLogsResponse: 含日志文本及 S3 链接
300
+ """
301
+ return self._run.get_run_task_logs(run_id, pod_name)
302
+
303
+ def get_run_task_pod(self, run_id: int, pod_name: str) -> GetRunTaskPodResponse:
304
+ """获取运行任务 Pod
305
+
306
+ Args:
307
+ run_id: 运行实例 ID
308
+ pod_name: 目标 Pod 名称(对应 task 节点)
309
+
310
+ Returns:
311
+ GetRunTaskPodResponse: 含 Pod 详细 YAML 字符串
312
+ """
313
+ return self._run.get_run_task_pod(run_id, pod_name)
314
+
315
+ def get_run_task_events(self, run_id: int, pod_name: str) -> GetRunTaskEventsResponse:
316
+ """查询运行任务 Pod 的事件记录
317
+
318
+ Args:
319
+ run_id: 运行实例 ID
320
+ pod_name: 目标 Pod 名称
321
+
322
+ Returns:
323
+ GetRunTaskEventsResponse: 事件文本等信息
324
+ """
325
+ return self._run.get_run_task_events(run_id, pod_name)
326
+
327
+ def select_run_users(self) -> list[RunUserBrief]:
328
+ """列出提交运行任务的用户
329
+
330
+ Returns:
331
+ list[RunUserBrief]: 用户 ID 与名称简要信息
332
+ """
333
+ return self._run.select_run_users()
334
+
335
+ @property
336
+ def pipeline(self) -> _Pipeline:
337
+ return self._pipeline
338
+
339
+ @property
340
+ def pipeline_version(self) -> _PipelineVersion:
341
+ return self._pipeline_version
342
+
343
+ @property
344
+ def run(self) -> _Run:
345
+ return self._run
346
+
347
+
348
+ class _Pipeline:
349
+
350
+ def __init__(self, http: httpx.Client):
351
+ self._http = http
352
+
353
+ def list(self, payload: ListPipelinesRequest) -> ListPipelinesResponse:
354
+ resp = self._http.get(f"{_BASE}/pipelines", params=payload.model_dump(by_alias=True, exclude_none=True))
355
+ wrapper = APIWrapper[ListPipelinesResponse].model_validate(resp.json())
356
+ if wrapper.code != 0:
357
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
358
+ return wrapper.data
359
+
360
+ def get(self, pipeline_id: int) -> Pipeline:
361
+ resp = self._http.get(f"{_BASE}/pipelines/{pipeline_id}")
362
+ wrapper = APIWrapper[Pipeline].model_validate(resp.json())
363
+ if wrapper.code != 0:
364
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
365
+ return wrapper.data
366
+
367
+ def create(self, payload: CreatePipelineRequest) -> int:
368
+ resp = self._http.post(f"{_BASE}/pipelines", json=payload.model_dump(by_alias=True, exclude_none=True))
369
+ wrapper = APIWrapper[CreatePipelineResponse].model_validate(resp.json())
370
+ if wrapper.code != 0:
371
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
372
+ return wrapper.data.id
373
+
374
+ def delete(self, pipeline_id: int) -> None:
375
+ resp = self._http.delete(f"{_BASE}/pipelines/{pipeline_id}")
376
+ wrapper = APIWrapper[dict].model_validate(resp.json())
377
+ if wrapper.code != 0:
378
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
379
+
380
+ def select(self, payload: SelectPipelinesRequest) -> SelectPipelinesResponse:
381
+ resp = self._http.get(f"{_BASE}/select-pipelines", params=payload.model_dump(by_alias=True, exclude_none=True))
382
+ wrapper = APIWrapper[SelectPipelinesResponse].model_validate(resp.json())
383
+ if wrapper.code != 0:
384
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
385
+ return wrapper.data
386
+
387
+ def select_users(self) -> SelectPipelineUsersResponse:
388
+ resp = self._http.get(f"{_BASE}/select-pipeline-users")
389
+ wrapper = APIWrapper[SelectPipelineUsersResponse].model_validate(resp.json())
390
+ if wrapper.code != 0:
391
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
392
+ return wrapper.data
393
+
394
+
395
+ class _PipelineVersion:
396
+
397
+ def __init__(self, http: httpx.Client):
398
+ self._http = http
399
+
400
+ def list(self, payload: ListPipelineVersionsRequest) -> ListPipelineVersionsResponse:
401
+ resp = self._http.get(f"{_BASE}/pipeline-versions", params=payload.model_dump(by_alias=True, exclude_none=True))
402
+ wrapper = APIWrapper[ListPipelineVersionsResponse].model_validate(resp.json())
403
+ if wrapper.code != 0:
404
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
405
+ return wrapper.data
406
+
407
+ def get(self, version_id: int) -> PipelineVersion:
408
+ resp = self._http.get(f"{_BASE}/pipeline-versions/{version_id}")
409
+ wrapper = APIWrapper[PipelineVersion].model_validate(resp.json())
410
+ if wrapper.code != 0:
411
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
412
+ return wrapper.data
413
+
414
+ def create(self, payload: CreatePipelineVersionRequest) -> int:
415
+ resp = self._http.post(f"{_BASE}/pipeline-versions", json=payload.model_dump(by_alias=True, exclude_none=True))
416
+ wrapper = APIWrapper[CreatePipelineVersionResponse].model_validate(resp.json())
417
+ if wrapper.code != 0:
418
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
419
+ return wrapper.data.id
420
+
421
+ def delete(self, version_id: int) -> None:
422
+ resp = self._http.delete(f"{_BASE}/pipeline-versions/{version_id}")
423
+ wrapper = APIWrapper[dict].model_validate(resp.json())
424
+ if wrapper.code != 0:
425
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
426
+
427
+ def select(self, payload: SelectPipelineVersionsRequest) -> SelectPipelineVersionsResponse:
428
+ resp = self._http.get(f"{_BASE}/select-pipeline-versions",
429
+ params=payload.model_dump(by_alias=True, exclude_none=True))
430
+ wrapper = APIWrapper[SelectPipelineVersionsResponse].model_validate(resp.json())
431
+ if wrapper.code != 0:
432
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
433
+ return wrapper.data
434
+
435
+ def get_input_params(self, version_id: int) -> GetPipelineVersionInputParamsResponse:
436
+ resp = self._http.get(f"{_BASE}/pipeline-versions/{version_id}/input-params")
437
+ wrapper = APIWrapper[GetPipelineVersionInputParamsResponse].model_validate(resp.json())
438
+ if wrapper.code != 0:
439
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
440
+ return wrapper.data
441
+
442
+ def migrate(self, payload: MigratePipelineVersionsRequest) -> None:
443
+ resp = self._http.post(f"{_BASE}/migrate-pipeline-versions", json=payload.model_dump(by_alias=True))
444
+ wrapper = APIWrapper[dict].model_validate(resp.json())
445
+ if wrapper.code != 0:
446
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
447
+
448
+
449
+ class _Run:
450
+
451
+ def __init__(self, http: httpx.Client):
452
+ self._http = http
453
+
454
+ def list_runs(self, payload: ListRunsRequest) -> ListRunsResponse:
455
+ resp = self._http.get(f"{_BASE}/runs", params=payload.model_dump(by_alias=True, exclude_none=True))
456
+ wrapper = APIWrapper[ListRunsResponse].model_validate(resp.json())
457
+ if wrapper.code != 0:
458
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
459
+ return wrapper.data
460
+
461
+ def get_run(self, run_id: int) -> Run:
462
+ resp = self._http.get(f"{_BASE}/runs/{run_id}")
463
+ wrapper = APIWrapper[Run].model_validate(resp.json())
464
+ if wrapper.code != 0:
465
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
466
+ return wrapper.data
467
+
468
+ def create_run(self, payload: CreateRunRequest) -> int:
469
+ resp = self._http.post(f"{_BASE}/runs", json=payload.model_dump(by_alias=True, exclude_none=True))
470
+ wrapper = APIWrapper[CreateRunResponse].model_validate(resp.json())
471
+ if wrapper.code != 0:
472
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
473
+ return wrapper.data.id
474
+
475
+ def retry_run(self, run_id: int) -> Run:
476
+ resp = self._http.put(f"{_BASE}/runs/{run_id}/retry")
477
+ wrapper = APIWrapper[RetryRunResponse].model_validate(resp.json())
478
+ if wrapper.code != 0:
479
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
480
+ return wrapper.data
481
+
482
+ def stop_run(self, run_id: int) -> Run:
483
+ resp = self._http.put(f"{_BASE}/runs/{run_id}/stop")
484
+ wrapper = APIWrapper[StopRunResponse].model_validate(resp.json())
485
+ if wrapper.code != 0:
486
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
487
+ return wrapper.data
488
+
489
+ def resubmit_run(self, run_id: int) -> Run:
490
+ resp = self._http.put(f"{_BASE}/runs/{run_id}/resubmit")
491
+ wrapper = APIWrapper[ResubmitRunResponse].model_validate(resp.json())
492
+ if wrapper.code != 0:
493
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
494
+ return wrapper.data
495
+
496
+ def get_run_task_logs(self, run_id: int, pod_name: str) -> GetRunTaskLogsResponse:
497
+ resp = self._http.get(f"{_BASE}/runs/{run_id}/tasks/{pod_name}/logs")
498
+ wrapper = APIWrapper[GetRunTaskLogsResponse].model_validate(resp.json())
499
+ if wrapper.code != 0:
500
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
501
+ return wrapper.data
502
+
503
+ def get_run_task_pod(self, run_id: int, pod_name: str) -> GetRunTaskPodResponse:
504
+ resp = self._http.get(f"{_BASE}/runs/{run_id}/tasks/{pod_name}/pod")
505
+ wrapper = APIWrapper[GetRunTaskPodResponse].model_validate(resp.json())
506
+ if wrapper.code != 0:
507
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
508
+ return wrapper.data
509
+
510
+ def get_run_task_events(self, run_id: int, pod_name: str) -> GetRunTaskEventsResponse:
511
+ resp = self._http.get(f"{_BASE}/runs/{run_id}/tasks/{pod_name}/events")
512
+ wrapper = APIWrapper[GetRunTaskEventsResponse].model_validate(resp.json())
513
+ if wrapper.code != 0:
514
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
515
+ return wrapper.data
516
+
517
+ def select_run_users(self) -> List[RunUserBrief]:
518
+ resp = self._http.get(f"{_BASE}/select-run-users")
519
+ wrapper = APIWrapper[SelectRunUsersResponse].model_validate(resp.json())
520
+ if wrapper.code != 0:
521
+ raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
522
+ return wrapper.data.data
aihub/utils/download.py CHANGED
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  import concurrent.futures
4
4
  import os
5
5
  import tempfile
6
+ import zipfile
6
7
  from typing import List, TypedDict
7
8
 
8
9
  import pyarrow.parquet as pq
@@ -51,14 +52,17 @@ def dataset_download(index_url: str, local_dir: str, worker: int = 4) -> None:
51
52
  ),
52
53
  s3_to_url(row["s3path"], host),
53
54
  )
54
- for row in rows if row["type"] == _ENUM_FILE
55
+ for row in rows
56
+ if row["type"] == _ENUM_FILE
55
57
  ]
56
58
 
57
59
  if worker < 1:
58
60
  worker = 1
59
61
 
60
- with tqdm(total=len(files), desc="Downloading dataset") as bar, \
61
- concurrent.futures.ThreadPoolExecutor(max_workers=worker) as pool:
62
+ with (
63
+ tqdm(total=len(files), desc="Downloading dataset") as bar,
64
+ concurrent.futures.ThreadPoolExecutor(max_workers=worker) as pool,
65
+ ):
62
66
 
63
67
  def _one(flocal: str, furl: str):
64
68
  http_download_file(furl, flocal)
@@ -67,3 +71,15 @@ def dataset_download(index_url: str, local_dir: str, worker: int = 4) -> None:
67
71
  futures = [pool.submit(_one, p, u) for p, u in files]
68
72
  for fut in concurrent.futures.as_completed(futures):
69
73
  fut.result()
74
+
75
+
76
+ def zip_dir(dir_path: str, zip_path: str):
77
+ zip_file = zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED)
78
+ for root, dirs, files in os.walk(dir_path):
79
+ for file in files:
80
+ zip_file.write(
81
+ os.path.join(root, file),
82
+ os.path.relpath(os.path.join(root, file), dir_path),
83
+ )
84
+
85
+ zip_file.close()
@@ -1,19 +1,19 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: intellif-aihub
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: Intellif AI-hub SDK.
5
5
  Author-email: Platform Team <aihub@example.com>
6
6
  License-Expression: Apache-2.0
7
7
  Keywords: AI-hub,sdk,intellif
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Operating System :: OS Independent
10
- Requires-Python: >=3.8
10
+ Requires-Python: >=3.9
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
13
  Requires-Dist: httpx<0.28,>=0.27
14
14
  Requires-Dist: pydantic<3.0,>=2.5.3
15
15
  Requires-Dist: typing-extensions<5.0,>=4.13.2
16
- Requires-Dist: pyarrow<16.0,>=15.0.2
16
+ Requires-Dist: pyarrow>=21.0.0
17
17
  Requires-Dist: tqdm<5.0,>=4.66
18
18
  Requires-Dist: loguru>=0.7.3
19
19
  Requires-Dist: minio>=7.2.7
@@ -0,0 +1,42 @@
1
+ aihub/__init__.py,sha256=n3oM6B_EMz93NsTI18NNZd-jKFcUPzUkbIKj5VFK5ok,22
2
+ aihub/client.py,sha256=bIYL-NoXarSFnPwLzEcWqUjdiTZ7sau5DmGz8YX4-RQ,5144
3
+ aihub/exceptions.py,sha256=l2cMAvipTqQOio3o11fXsCCSCevbuK4PTsxofkobFjk,500
4
+ aihub/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ aihub/models/artifact.py,sha256=V1rPNn9pUwSP0M7FvLIqR9Q7429JYbTU2tB-hUEJ04w,3533
6
+ aihub/models/common.py,sha256=qmabc2LkAdQJXIcpT1P35zxd0Lc8yDYdD4ame1iF4Bs,241
7
+ aihub/models/data_warehouse.py,sha256=3LEZ8IUDPOtJwMJ_bmcXyj_ST5ia_1CVrcGFjgT-6r8,3825
8
+ aihub/models/dataset_management.py,sha256=QErbFBsd1-Pux_pT8mG_2e8g88MK3iulXN0lny0dw30,6323
9
+ aihub/models/document_center.py,sha256=JVA-6hYSY-efmhDmb6nNJEFk-MK5TZjXpwjwxWPfsCk,1298
10
+ aihub/models/eval.py,sha256=4Gon4Sg4dOkyCx3KH2mO5ip3AhrBwrPC0UZA447HeoQ,910
11
+ aihub/models/labelfree.py,sha256=nljprYO6ECuctTVbHqriQ73N5EEyYURhBrnU28Ngfvc,1589
12
+ aihub/models/model_center.py,sha256=K94u6tsIP86Ws3P93O8uoO1gBmnamVnoxlDzvjiPLSo,5719
13
+ aihub/models/model_training_platform.py,sha256=ewkbYifUlGgdxsReXeqXxfSmrgwfACDo5Rtlz4hNmpM,11864
14
+ aihub/models/quota_schedule_management.py,sha256=RDRoQypS2tNaNmiU_9Aj7yciG8knTzg6r4kNmgE8leQ,12743
15
+ aihub/models/tag_resource_management.py,sha256=-FgiKyDIG7bZagzVRf-8rXWuqH9GyciDadxz5W2f3I8,2195
16
+ aihub/models/task_center.py,sha256=Koz1Bet6PCJRLmoUMqz0eCQCRr0y4yEK1KmIgLXfOHM,5269
17
+ aihub/models/user_system.py,sha256=0L_pBkWL9v1tv_mclOyRgCyWibuuj_XU3mPoe2v48vQ,12216
18
+ aihub/models/workflow_center.py,sha256=5li_nZ_UuiAfVG5waSwP3mYViQZ6Z7dlwxv67HNUc_I,19879
19
+ aihub/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
+ aihub/services/artifact.py,sha256=PtCGhYFpFK_hppQr7A0bdXvceXzmYSwEpRj-PE2rIcQ,11473
21
+ aihub/services/data_warehouse.py,sha256=awvlJdggo8ph6sXweXXVp4GLRuUSD46LoD0QQksXRts,2964
22
+ aihub/services/dataset_management.py,sha256=KB-NZpcQwixOpEkQ1xI0gKzvWA3A6ay6aQzFQoUfXXU,12847
23
+ aihub/services/document_center.py,sha256=dG67Ji-DOnzL2t-4x4gVfMt9fbSj_IjVHCLw5R-VTkQ,1813
24
+ aihub/services/eval.py,sha256=V1nBISIyYWg9JJO24xzy4-kit9NsaCYp1EWIX_fgJkQ,2128
25
+ aihub/services/labelfree.py,sha256=xua62UWhVXTxJjHRyy86waaormnJjmpQwepcARBy_h0,1450
26
+ aihub/services/model_center.py,sha256=QZXlldPZrbC6YkVG3eGw5_53qvFAim2QlXg3DflByTA,6215
27
+ aihub/services/model_training_platform.py,sha256=UR8JGUbZKHauusxCq_hMPtyRT1QziqD_6mMFjK80uBY,9648
28
+ aihub/services/quota_schedule_management.py,sha256=UYOMwjXxJTgkpN6Rv5GzlcejtpZfu23PXlSKr0WihTY,9586
29
+ aihub/services/reporter.py,sha256=ot93SmhxgwDJOzlHSCwlxDOuSydTWUEUQ-Ctp97wJBQ,669
30
+ aihub/services/tag_resource_management.py,sha256=Bm_inSIzZbTc-e4LU9kvwtsPpM_yLwm8xzdrALjb6uY,2666
31
+ aihub/services/task_center.py,sha256=OZ2cnmO5hQSPTZu1FF6lmGCdn8b2mUg6vFnARisHVdU,6580
32
+ aihub/services/user_system.py,sha256=IqWL4bnsKyyzuGT5l6adnw0qNXlH9PSo1-C_pFyOSzA,18868
33
+ aihub/services/workflow_center.py,sha256=caKxOlba0J1s1RUK6RUm1ndJSwAcZXEakRanu3sGKPU,17468
34
+ aihub/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
+ aihub/utils/download.py,sha256=yC3SoL5uE68pMB-IsNz233wj-gFrHB7D7ALzQA5JkFM,2155
36
+ aihub/utils/http.py,sha256=rSNh4uNP7E3YGm3H1indRHctxC5Wu5xNBPvDrb9UHt4,421
37
+ aihub/utils/s3.py,sha256=ISIBP-XdBPkURpXnN56ZnIWokOOg2SRUh_qvxJk-G1Q,2187
38
+ intellif_aihub-0.1.6.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
39
+ intellif_aihub-0.1.6.dist-info/METADATA,sha256=BVzQ1sfR3t5GCyC1NWhTJrgfIJNP3_FSr8ddqHiXIOY,2916
40
+ intellif_aihub-0.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
41
+ intellif_aihub-0.1.6.dist-info/top_level.txt,sha256=vIvTtSIN73xv46BpYM-ctVGnyOiUQ9EWP_6ngvdIlvw,6
42
+ intellif_aihub-0.1.6.dist-info/RECORD,,
@@ -1,36 +0,0 @@
1
- aihub/__init__.py,sha256=Wzf5T3NBDfhQoTnhnRNHSlAsE0XMqbclXG-M81Vas70,22
2
- aihub/client.py,sha256=Eu0evMLB_aWyqL0VOFTfNh0XYQb9Ohob4dnaLzVrfNI,3779
3
- aihub/exceptions.py,sha256=l2cMAvipTqQOio3o11fXsCCSCevbuK4PTsxofkobFjk,500
4
- aihub/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- aihub/models/artifact.py,sha256=I07sXB3iIRlVnHm1HkYCXKIIPt5RGncxXuxANat8Vzs,3530
6
- aihub/models/common.py,sha256=qmabc2LkAdQJXIcpT1P35zxd0Lc8yDYdD4ame1iF4Bs,241
7
- aihub/models/dataset_management.py,sha256=lP92aOsZJihg4SEhf1jeITcXp-N8l_YzHYf1l9Zq7-g,3381
8
- aihub/models/document_center.py,sha256=xmAk_JIY3GjuVDZurMUonmSz3Siy3TAxhj3ewIJ6dUQ,489
9
- aihub/models/eval.py,sha256=5h25jR4-JeZ-Sbq0ifp6fd1IVrq0I3w-S8YV_BFUDao,326
10
- aihub/models/labelfree.py,sha256=RgSCWPQ-_XHbCjalaTDQcgGAQXCKObVs38h2kTpRm88,1755
11
- aihub/models/model_training_platform.py,sha256=IWgGZ60A9qjLxj1srC3dUc6a-i8gLe8D2yASJ3HeNRY,6521
12
- aihub/models/quota_schedule_management.py,sha256=E_q6x5KaJOyrOPlYqBumwDgKB1uRpfOHSsYgMxqI6MA,6801
13
- aihub/models/tag_resource_management.py,sha256=httqeAjCypqykkmhJXSjJfL4Qlfqz21y3w2qXEYtT6g,1104
14
- aihub/models/task_center.py,sha256=0Sbxsi7mwKUsotO5_4EpQ1dE8goYcI9jnPWLJ5YzfpA,4030
15
- aihub/models/user_system.py,sha256=4hhOw6DJVjqoJKLkhPbRZnzMOITH2s-t40id1d409zE,7433
16
- aihub/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- aihub/services/artifact.py,sha256=Ye2T78KZFwDLFK7ngvqw712HxSfoNwoNdJ71-wjd4YI,11201
18
- aihub/services/dataset_management.py,sha256=fqGJATO1kisPfjk7GxKlzh9fU2w42FeeWEAh-WRDJto,8669
19
- aihub/services/document_center.py,sha256=DClItxWXMMFPnKMR7kyNGohhXP3wowImj-Lm8vzBgNo,1339
20
- aihub/services/eval.py,sha256=X6NBV6PTsczoeulV2y1ySrr9GB9R5EBaXgjEmiiUiCE,1963
21
- aihub/services/labelfree.py,sha256=UUuq519us1fma0ERXM-sXfLPWRHB1f6BqE2XvCq-3Pw,1215
22
- aihub/services/model_training_platform.py,sha256=fsCO4BEuja_1ePl0hwt32kpnN99AArjzBv_e459p0X4,7560
23
- aihub/services/quota_schedule_management.py,sha256=4MdtEP2Ziz6hh3tXmd6nbLXxtQ46Z_eT2VtjE3Kr-0I,6803
24
- aihub/services/reporter.py,sha256=ot93SmhxgwDJOzlHSCwlxDOuSydTWUEUQ-Ctp97wJBQ,669
25
- aihub/services/tag_resource_management.py,sha256=GcuVMlwGlfZkvUKvLUTKtteHNjurlLr2FUy2Eg8cfyE,1811
26
- aihub/services/task_center.py,sha256=xhyMdmhFjeL9QZ5YZ0eGz6WIgclECitG8Yp_dXO7OEY,6211
27
- aihub/services/user_system.py,sha256=vEcwvSX28lMp7YBUm1AWRDujEa73NqOtwMQi-t7xPSM,13654
28
- aihub/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- aihub/utils/download.py,sha256=Rh1m3VpMlw8-Kl36sowJ7M0dpB68u-9V4Vo3GQChq1I,1758
30
- aihub/utils/http.py,sha256=rSNh4uNP7E3YGm3H1indRHctxC5Wu5xNBPvDrb9UHt4,421
31
- aihub/utils/s3.py,sha256=ISIBP-XdBPkURpXnN56ZnIWokOOg2SRUh_qvxJk-G1Q,2187
32
- intellif_aihub-0.1.4.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
33
- intellif_aihub-0.1.4.dist-info/METADATA,sha256=mlbDkkXv80KPI2iemhKP2NqnSZsERhvC_clQXzjB4IM,2922
34
- intellif_aihub-0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
- intellif_aihub-0.1.4.dist-info/top_level.txt,sha256=vIvTtSIN73xv46BpYM-ctVGnyOiUQ9EWP_6ngvdIlvw,6
36
- intellif_aihub-0.1.4.dist-info/RECORD,,