xiaoshiai-hub 1.1.2__tar.gz → 1.1.4__tar.gz
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.
- {xiaoshiai_hub-1.1.2/xiaoshiai_hub.egg-info → xiaoshiai_hub-1.1.4}/PKG-INFO +158 -7
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/README.md +156 -6
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/pyproject.toml +2 -1
- xiaoshiai_hub-1.1.4/requirements.txt +3 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/setup.py +2 -1
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub/cli.py +457 -5
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub/client.py +192 -4
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub/types.py +4 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub/upload.py +58 -22
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4/xiaoshiai_hub.egg-info}/PKG-INFO +158 -7
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub.egg-info/requires.txt +1 -0
- xiaoshiai_hub-1.1.2/requirements.txt +0 -2
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/LICENSE +0 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/MANIFEST.in +0 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/setup.cfg +0 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub/__init__.py +0 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub/auth.py +0 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub/download.py +0 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub/envelope_crypto.py +0 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub/exceptions.py +0 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub.egg-info/SOURCES.txt +0 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub.egg-info/dependency_links.txt +0 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub.egg-info/entry_points.txt +0 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub.egg-info/not-zip-safe +0 -0
- {xiaoshiai_hub-1.1.2 → xiaoshiai_hub-1.1.4}/xiaoshiai_hub.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xiaoshiai-hub
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.4
|
|
4
4
|
Summary: Python SDK for XiaoShi AI Hub - Upload, download, and manage AI models and datasets with xpai-enc encryption support
|
|
5
5
|
Home-page: https://github.com/poxiaoyun/moha-sdk
|
|
6
6
|
Author: XiaoShi AI
|
|
@@ -31,6 +31,7 @@ Description-Content-Type: text/markdown
|
|
|
31
31
|
License-File: LICENSE
|
|
32
32
|
Requires-Dist: requests>=2.20.0
|
|
33
33
|
Requires-Dist: tqdm>=4.62.0
|
|
34
|
+
Requires-Dist: cryptography>=46.0.3
|
|
34
35
|
Provides-Extra: upload
|
|
35
36
|
Requires-Dist: gitpython>=3.1.0; extra == "upload"
|
|
36
37
|
Provides-Extra: encryption
|
|
@@ -244,20 +245,53 @@ client = HubClient(
|
|
|
244
245
|
password="your-password",
|
|
245
246
|
)
|
|
246
247
|
|
|
248
|
+
# 创建仓库
|
|
249
|
+
repo = client.create_repository(
|
|
250
|
+
organization="demo",
|
|
251
|
+
repo_type="models",
|
|
252
|
+
repo_name="my-model",
|
|
253
|
+
description="我的模型",
|
|
254
|
+
visibility="internal",
|
|
255
|
+
metadata={
|
|
256
|
+
"license": ["apache-2.0"],
|
|
257
|
+
"frameworks": ["transformers"],
|
|
258
|
+
},
|
|
259
|
+
)
|
|
260
|
+
print(f"仓库已创建: {repo.name}")
|
|
261
|
+
|
|
247
262
|
# 获取仓库信息
|
|
248
263
|
repo_info = client.get_repository_info("demo", "models", "my-model")
|
|
249
264
|
print(f"仓库名称: {repo_info.name}")
|
|
250
265
|
print(f"组织: {repo_info.organization}")
|
|
266
|
+
print(f"所有者: {repo_info.owner}")
|
|
267
|
+
print(f"可见性: {repo_info.visibility}")
|
|
268
|
+
|
|
269
|
+
# 更新仓库
|
|
270
|
+
client.update_repository(
|
|
271
|
+
organization="demo",
|
|
272
|
+
repo_type="models",
|
|
273
|
+
repo_name="my-model",
|
|
274
|
+
description="更新后的描述",
|
|
275
|
+
)
|
|
251
276
|
|
|
252
277
|
# 列出分支
|
|
253
|
-
|
|
254
|
-
for
|
|
255
|
-
print(f"分支: {
|
|
278
|
+
refs = client.get_repository_refs("demo", "models", "my-model")
|
|
279
|
+
for ref in refs:
|
|
280
|
+
print(f"分支: {ref.name} (commit: {ref.hash[:8]})")
|
|
281
|
+
|
|
282
|
+
# 创建分支(幂等操作,已存在则直接返回)
|
|
283
|
+
client.create_branch("demo", "models", "my-model", "dev", "main")
|
|
284
|
+
|
|
285
|
+
# 删除分支(幂等操作,不存在则直接返回)
|
|
286
|
+
client.delete_branch("demo", "models", "my-model", "dev")
|
|
256
287
|
|
|
257
288
|
# 浏览仓库内容
|
|
258
289
|
content = client.get_repository_content("demo", "models", "my-model", "main")
|
|
259
290
|
for entry in content.entries:
|
|
260
291
|
print(f"{entry.type}: {entry.name}")
|
|
292
|
+
|
|
293
|
+
# 删除仓库
|
|
294
|
+
client.delete_repository("demo", "models", "my-model")
|
|
261
295
|
```
|
|
262
296
|
|
|
263
297
|
## 🔐 加密功能
|
|
@@ -343,7 +377,7 @@ export MOHA_ENCRYPTION_PASSWORD="your-encryption-password"
|
|
|
343
377
|
|
|
344
378
|
## 🖥️ 命令行工具 (CLI)
|
|
345
379
|
|
|
346
|
-
SDK 提供了 `moha`
|
|
380
|
+
SDK 提供了 `moha` 命令行工具,支持登录认证、仓库管理、分支管理、上传下载等操作。
|
|
347
381
|
|
|
348
382
|
### 基本用法
|
|
349
383
|
|
|
@@ -351,6 +385,75 @@ SDK 提供了 `moha` 命令行工具,支持常见的上传下载操作。
|
|
|
351
385
|
moha --help
|
|
352
386
|
```
|
|
353
387
|
|
|
388
|
+
### 登录认证
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
# 登录(交互式输入用户名和密码)
|
|
392
|
+
moha login
|
|
393
|
+
|
|
394
|
+
# 直接指定用户名和密码
|
|
395
|
+
moha login --username your-username --password your-password
|
|
396
|
+
|
|
397
|
+
# 查看当前登录状态
|
|
398
|
+
moha whoami
|
|
399
|
+
|
|
400
|
+
# 退出登录
|
|
401
|
+
moha logout
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
登录后,Token 会保存到 `~/.moha/token.json`,后续命令无需重复输入认证信息。
|
|
405
|
+
|
|
406
|
+
### 仓库管理
|
|
407
|
+
|
|
408
|
+
```bash
|
|
409
|
+
# 创建仓库
|
|
410
|
+
moha repo-create org/my-model \
|
|
411
|
+
--description "我的模型" \
|
|
412
|
+
--visibility internal \
|
|
413
|
+
--license apache-2.0 \
|
|
414
|
+
--tasks text-generation \
|
|
415
|
+
--frameworks transformers
|
|
416
|
+
|
|
417
|
+
# 创建数据集仓库
|
|
418
|
+
moha repo-create org/my-dataset \
|
|
419
|
+
--repo-type datasets \
|
|
420
|
+
--description "我的数据集" \
|
|
421
|
+
--visibility private
|
|
422
|
+
|
|
423
|
+
# 查看仓库信息
|
|
424
|
+
moha repo-info org/my-model
|
|
425
|
+
|
|
426
|
+
# 更新仓库信息
|
|
427
|
+
moha repo-update org/my-model \
|
|
428
|
+
--description "更新后的描述" \
|
|
429
|
+
--tags production
|
|
430
|
+
|
|
431
|
+
# 删除仓库(需要确认)
|
|
432
|
+
moha repo-delete org/my-model
|
|
433
|
+
|
|
434
|
+
# 跳过确认直接删除
|
|
435
|
+
moha repo-delete org/my-model -y
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
### 分支管理
|
|
439
|
+
|
|
440
|
+
```bash
|
|
441
|
+
# 列出仓库的所有分支
|
|
442
|
+
moha branch-list org/my-model
|
|
443
|
+
|
|
444
|
+
# 创建分支(基于 main 分支)
|
|
445
|
+
moha branch-create org/my-model dev
|
|
446
|
+
|
|
447
|
+
# 创建分支(基于指定分支)
|
|
448
|
+
moha branch-create org/my-model feature --from dev
|
|
449
|
+
|
|
450
|
+
# 删除分支
|
|
451
|
+
moha branch-delete org/my-model dev
|
|
452
|
+
|
|
453
|
+
# 跳过确认直接删除
|
|
454
|
+
moha branch-delete org/my-model dev -y
|
|
455
|
+
```
|
|
456
|
+
|
|
354
457
|
### 上传文件夹
|
|
355
458
|
|
|
356
459
|
```bash
|
|
@@ -444,16 +547,42 @@ moha download-file org/my-model model.safetensors \
|
|
|
444
547
|
--password your-password
|
|
445
548
|
```
|
|
446
549
|
|
|
550
|
+
### CLI 命令列表
|
|
551
|
+
|
|
552
|
+
| 命令 | 说明 |
|
|
553
|
+
|------|------|
|
|
554
|
+
| `moha login` | 登录并保存 Token |
|
|
555
|
+
| `moha logout` | 退出登录并删除 Token |
|
|
556
|
+
| `moha whoami` | 查看当前登录状态 |
|
|
557
|
+
| `moha repo-create` | 创建仓库 |
|
|
558
|
+
| `moha repo-update` | 更新仓库 |
|
|
559
|
+
| `moha repo-delete` | 删除仓库 |
|
|
560
|
+
| `moha repo-info` | 查看仓库信息 |
|
|
561
|
+
| `moha branch-create` | 创建分支 |
|
|
562
|
+
| `moha branch-delete` | 删除分支 |
|
|
563
|
+
| `moha branch-list` | 列出仓库的所有分支 |
|
|
564
|
+
| `moha upload` | 上传文件夹到仓库 |
|
|
565
|
+
| `moha upload-file` | 上传单个文件到仓库 |
|
|
566
|
+
| `moha download` | 下载整个仓库 |
|
|
567
|
+
| `moha download-file` | 从仓库下载单个文件 |
|
|
568
|
+
|
|
447
569
|
### CLI 参数说明
|
|
448
570
|
|
|
571
|
+
#### 通用参数
|
|
572
|
+
|
|
449
573
|
| 参数 | 说明 | 适用命令 |
|
|
450
574
|
|------|------|----------|
|
|
451
|
-
| `--repo-type, -t` | 仓库类型:`models` 或 `datasets`(默认:models) |
|
|
452
|
-
| `--revision, -r` | 分支/标签/提交(默认:main) | 所有 |
|
|
575
|
+
| `--repo-type, -t` | 仓库类型:`models` 或 `datasets`(默认:models) | 大部分命令 |
|
|
453
576
|
| `--base-url` | API 基础 URL(默认:环境变量 MOHA_ENDPOINT) | 所有 |
|
|
454
577
|
| `--token` | 认证令牌 | 所有 |
|
|
455
578
|
| `--username` | 用户名 | 所有 |
|
|
456
579
|
| `--password` | 密码 | 所有 |
|
|
580
|
+
|
|
581
|
+
#### 上传/下载参数
|
|
582
|
+
|
|
583
|
+
| 参数 | 说明 | 适用命令 |
|
|
584
|
+
|------|------|----------|
|
|
585
|
+
| `--revision, -r` | 分支/标签/提交(默认:main) | upload, download |
|
|
457
586
|
| `--message, -m` | 提交消息 | upload, upload-file |
|
|
458
587
|
| `--ignore, -i` | 忽略模式(可多次使用) | upload, download |
|
|
459
588
|
| `--include` | 包含模式(可多次使用) | download |
|
|
@@ -465,6 +594,28 @@ moha download-file org/my-model model.safetensors \
|
|
|
465
594
|
| `--local-dir, -o` | 本地保存目录 | download, download-file |
|
|
466
595
|
| `--quiet, -q` | 禁用进度条 | download, download-file |
|
|
467
596
|
|
|
597
|
+
#### 仓库管理参数
|
|
598
|
+
|
|
599
|
+
| 参数 | 说明 | 适用命令 |
|
|
600
|
+
|------|------|----------|
|
|
601
|
+
| `--description, -d` | 仓库描述 | repo-create, repo-update |
|
|
602
|
+
| `--visibility, -v` | 可见性:`public`、`internal`、`private` | repo-create, repo-update |
|
|
603
|
+
| `--license` | 许可证(可多次使用) | repo-create, repo-update |
|
|
604
|
+
| `--tasks` | 任务类型(可多次使用) | repo-create, repo-update |
|
|
605
|
+
| `--languages` | 语言(可多次使用) | repo-create, repo-update |
|
|
606
|
+
| `--tags` | 标签(可多次使用) | repo-create, repo-update |
|
|
607
|
+
| `--frameworks` | 框架(可多次使用) | repo-create, repo-update |
|
|
608
|
+
| `--base-model` | 基础模型(可多次使用) | repo-create, repo-update |
|
|
609
|
+
| `--relationship` | 与基础模型的关系 | repo-create, repo-update |
|
|
610
|
+
| `--yes, -y` | 跳过确认提示 | repo-delete, branch-delete |
|
|
611
|
+
|
|
612
|
+
#### 分支管理参数
|
|
613
|
+
|
|
614
|
+
| 参数 | 说明 | 适用命令 |
|
|
615
|
+
|------|------|----------|
|
|
616
|
+
| `--from, -f` | 基于哪个分支创建(默认:main) | branch-create |
|
|
617
|
+
| `--yes, -y` | 跳过确认提示 | branch-delete |
|
|
618
|
+
|
|
468
619
|
### 使用环境变量
|
|
469
620
|
|
|
470
621
|
可以通过环境变量设置认证信息,避免每次输入:
|
|
@@ -189,20 +189,53 @@ client = HubClient(
|
|
|
189
189
|
password="your-password",
|
|
190
190
|
)
|
|
191
191
|
|
|
192
|
+
# 创建仓库
|
|
193
|
+
repo = client.create_repository(
|
|
194
|
+
organization="demo",
|
|
195
|
+
repo_type="models",
|
|
196
|
+
repo_name="my-model",
|
|
197
|
+
description="我的模型",
|
|
198
|
+
visibility="internal",
|
|
199
|
+
metadata={
|
|
200
|
+
"license": ["apache-2.0"],
|
|
201
|
+
"frameworks": ["transformers"],
|
|
202
|
+
},
|
|
203
|
+
)
|
|
204
|
+
print(f"仓库已创建: {repo.name}")
|
|
205
|
+
|
|
192
206
|
# 获取仓库信息
|
|
193
207
|
repo_info = client.get_repository_info("demo", "models", "my-model")
|
|
194
208
|
print(f"仓库名称: {repo_info.name}")
|
|
195
209
|
print(f"组织: {repo_info.organization}")
|
|
210
|
+
print(f"所有者: {repo_info.owner}")
|
|
211
|
+
print(f"可见性: {repo_info.visibility}")
|
|
212
|
+
|
|
213
|
+
# 更新仓库
|
|
214
|
+
client.update_repository(
|
|
215
|
+
organization="demo",
|
|
216
|
+
repo_type="models",
|
|
217
|
+
repo_name="my-model",
|
|
218
|
+
description="更新后的描述",
|
|
219
|
+
)
|
|
196
220
|
|
|
197
221
|
# 列出分支
|
|
198
|
-
|
|
199
|
-
for
|
|
200
|
-
print(f"分支: {
|
|
222
|
+
refs = client.get_repository_refs("demo", "models", "my-model")
|
|
223
|
+
for ref in refs:
|
|
224
|
+
print(f"分支: {ref.name} (commit: {ref.hash[:8]})")
|
|
225
|
+
|
|
226
|
+
# 创建分支(幂等操作,已存在则直接返回)
|
|
227
|
+
client.create_branch("demo", "models", "my-model", "dev", "main")
|
|
228
|
+
|
|
229
|
+
# 删除分支(幂等操作,不存在则直接返回)
|
|
230
|
+
client.delete_branch("demo", "models", "my-model", "dev")
|
|
201
231
|
|
|
202
232
|
# 浏览仓库内容
|
|
203
233
|
content = client.get_repository_content("demo", "models", "my-model", "main")
|
|
204
234
|
for entry in content.entries:
|
|
205
235
|
print(f"{entry.type}: {entry.name}")
|
|
236
|
+
|
|
237
|
+
# 删除仓库
|
|
238
|
+
client.delete_repository("demo", "models", "my-model")
|
|
206
239
|
```
|
|
207
240
|
|
|
208
241
|
## 🔐 加密功能
|
|
@@ -288,7 +321,7 @@ export MOHA_ENCRYPTION_PASSWORD="your-encryption-password"
|
|
|
288
321
|
|
|
289
322
|
## 🖥️ 命令行工具 (CLI)
|
|
290
323
|
|
|
291
|
-
SDK 提供了 `moha`
|
|
324
|
+
SDK 提供了 `moha` 命令行工具,支持登录认证、仓库管理、分支管理、上传下载等操作。
|
|
292
325
|
|
|
293
326
|
### 基本用法
|
|
294
327
|
|
|
@@ -296,6 +329,75 @@ SDK 提供了 `moha` 命令行工具,支持常见的上传下载操作。
|
|
|
296
329
|
moha --help
|
|
297
330
|
```
|
|
298
331
|
|
|
332
|
+
### 登录认证
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
# 登录(交互式输入用户名和密码)
|
|
336
|
+
moha login
|
|
337
|
+
|
|
338
|
+
# 直接指定用户名和密码
|
|
339
|
+
moha login --username your-username --password your-password
|
|
340
|
+
|
|
341
|
+
# 查看当前登录状态
|
|
342
|
+
moha whoami
|
|
343
|
+
|
|
344
|
+
# 退出登录
|
|
345
|
+
moha logout
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
登录后,Token 会保存到 `~/.moha/token.json`,后续命令无需重复输入认证信息。
|
|
349
|
+
|
|
350
|
+
### 仓库管理
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
# 创建仓库
|
|
354
|
+
moha repo-create org/my-model \
|
|
355
|
+
--description "我的模型" \
|
|
356
|
+
--visibility internal \
|
|
357
|
+
--license apache-2.0 \
|
|
358
|
+
--tasks text-generation \
|
|
359
|
+
--frameworks transformers
|
|
360
|
+
|
|
361
|
+
# 创建数据集仓库
|
|
362
|
+
moha repo-create org/my-dataset \
|
|
363
|
+
--repo-type datasets \
|
|
364
|
+
--description "我的数据集" \
|
|
365
|
+
--visibility private
|
|
366
|
+
|
|
367
|
+
# 查看仓库信息
|
|
368
|
+
moha repo-info org/my-model
|
|
369
|
+
|
|
370
|
+
# 更新仓库信息
|
|
371
|
+
moha repo-update org/my-model \
|
|
372
|
+
--description "更新后的描述" \
|
|
373
|
+
--tags production
|
|
374
|
+
|
|
375
|
+
# 删除仓库(需要确认)
|
|
376
|
+
moha repo-delete org/my-model
|
|
377
|
+
|
|
378
|
+
# 跳过确认直接删除
|
|
379
|
+
moha repo-delete org/my-model -y
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### 分支管理
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
# 列出仓库的所有分支
|
|
386
|
+
moha branch-list org/my-model
|
|
387
|
+
|
|
388
|
+
# 创建分支(基于 main 分支)
|
|
389
|
+
moha branch-create org/my-model dev
|
|
390
|
+
|
|
391
|
+
# 创建分支(基于指定分支)
|
|
392
|
+
moha branch-create org/my-model feature --from dev
|
|
393
|
+
|
|
394
|
+
# 删除分支
|
|
395
|
+
moha branch-delete org/my-model dev
|
|
396
|
+
|
|
397
|
+
# 跳过确认直接删除
|
|
398
|
+
moha branch-delete org/my-model dev -y
|
|
399
|
+
```
|
|
400
|
+
|
|
299
401
|
### 上传文件夹
|
|
300
402
|
|
|
301
403
|
```bash
|
|
@@ -389,16 +491,42 @@ moha download-file org/my-model model.safetensors \
|
|
|
389
491
|
--password your-password
|
|
390
492
|
```
|
|
391
493
|
|
|
494
|
+
### CLI 命令列表
|
|
495
|
+
|
|
496
|
+
| 命令 | 说明 |
|
|
497
|
+
|------|------|
|
|
498
|
+
| `moha login` | 登录并保存 Token |
|
|
499
|
+
| `moha logout` | 退出登录并删除 Token |
|
|
500
|
+
| `moha whoami` | 查看当前登录状态 |
|
|
501
|
+
| `moha repo-create` | 创建仓库 |
|
|
502
|
+
| `moha repo-update` | 更新仓库 |
|
|
503
|
+
| `moha repo-delete` | 删除仓库 |
|
|
504
|
+
| `moha repo-info` | 查看仓库信息 |
|
|
505
|
+
| `moha branch-create` | 创建分支 |
|
|
506
|
+
| `moha branch-delete` | 删除分支 |
|
|
507
|
+
| `moha branch-list` | 列出仓库的所有分支 |
|
|
508
|
+
| `moha upload` | 上传文件夹到仓库 |
|
|
509
|
+
| `moha upload-file` | 上传单个文件到仓库 |
|
|
510
|
+
| `moha download` | 下载整个仓库 |
|
|
511
|
+
| `moha download-file` | 从仓库下载单个文件 |
|
|
512
|
+
|
|
392
513
|
### CLI 参数说明
|
|
393
514
|
|
|
515
|
+
#### 通用参数
|
|
516
|
+
|
|
394
517
|
| 参数 | 说明 | 适用命令 |
|
|
395
518
|
|------|------|----------|
|
|
396
|
-
| `--repo-type, -t` | 仓库类型:`models` 或 `datasets`(默认:models) |
|
|
397
|
-
| `--revision, -r` | 分支/标签/提交(默认:main) | 所有 |
|
|
519
|
+
| `--repo-type, -t` | 仓库类型:`models` 或 `datasets`(默认:models) | 大部分命令 |
|
|
398
520
|
| `--base-url` | API 基础 URL(默认:环境变量 MOHA_ENDPOINT) | 所有 |
|
|
399
521
|
| `--token` | 认证令牌 | 所有 |
|
|
400
522
|
| `--username` | 用户名 | 所有 |
|
|
401
523
|
| `--password` | 密码 | 所有 |
|
|
524
|
+
|
|
525
|
+
#### 上传/下载参数
|
|
526
|
+
|
|
527
|
+
| 参数 | 说明 | 适用命令 |
|
|
528
|
+
|------|------|----------|
|
|
529
|
+
| `--revision, -r` | 分支/标签/提交(默认:main) | upload, download |
|
|
402
530
|
| `--message, -m` | 提交消息 | upload, upload-file |
|
|
403
531
|
| `--ignore, -i` | 忽略模式(可多次使用) | upload, download |
|
|
404
532
|
| `--include` | 包含模式(可多次使用) | download |
|
|
@@ -410,6 +538,28 @@ moha download-file org/my-model model.safetensors \
|
|
|
410
538
|
| `--local-dir, -o` | 本地保存目录 | download, download-file |
|
|
411
539
|
| `--quiet, -q` | 禁用进度条 | download, download-file |
|
|
412
540
|
|
|
541
|
+
#### 仓库管理参数
|
|
542
|
+
|
|
543
|
+
| 参数 | 说明 | 适用命令 |
|
|
544
|
+
|------|------|----------|
|
|
545
|
+
| `--description, -d` | 仓库描述 | repo-create, repo-update |
|
|
546
|
+
| `--visibility, -v` | 可见性:`public`、`internal`、`private` | repo-create, repo-update |
|
|
547
|
+
| `--license` | 许可证(可多次使用) | repo-create, repo-update |
|
|
548
|
+
| `--tasks` | 任务类型(可多次使用) | repo-create, repo-update |
|
|
549
|
+
| `--languages` | 语言(可多次使用) | repo-create, repo-update |
|
|
550
|
+
| `--tags` | 标签(可多次使用) | repo-create, repo-update |
|
|
551
|
+
| `--frameworks` | 框架(可多次使用) | repo-create, repo-update |
|
|
552
|
+
| `--base-model` | 基础模型(可多次使用) | repo-create, repo-update |
|
|
553
|
+
| `--relationship` | 与基础模型的关系 | repo-create, repo-update |
|
|
554
|
+
| `--yes, -y` | 跳过确认提示 | repo-delete, branch-delete |
|
|
555
|
+
|
|
556
|
+
#### 分支管理参数
|
|
557
|
+
|
|
558
|
+
| 参数 | 说明 | 适用命令 |
|
|
559
|
+
|------|------|----------|
|
|
560
|
+
| `--from, -f` | 基于哪个分支创建(默认:main) | branch-create |
|
|
561
|
+
| `--yes, -y` | 跳过确认提示 | branch-delete |
|
|
562
|
+
|
|
413
563
|
### 使用环境变量
|
|
414
564
|
|
|
415
565
|
可以通过环境变量设置认证信息,避免每次输入:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "xiaoshiai-hub"
|
|
7
|
-
version = "1.1.
|
|
7
|
+
version = "1.1.4"
|
|
8
8
|
description = "Python SDK for XiaoShi AI Hub - Upload, download, and manage AI models and datasets with xpai-enc encryption support"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.7"
|
|
@@ -47,6 +47,7 @@ classifiers = [
|
|
|
47
47
|
dependencies = [
|
|
48
48
|
"requests>=2.20.0",
|
|
49
49
|
"tqdm>=4.62.0",
|
|
50
|
+
"cryptography>=46.0.3"
|
|
50
51
|
]
|
|
51
52
|
|
|
52
53
|
[project.optional-dependencies]
|
|
@@ -17,7 +17,7 @@ else:
|
|
|
17
17
|
long_description = "Python SDK for XiaoShi AI Hub"
|
|
18
18
|
|
|
19
19
|
# Read version from __init__.py
|
|
20
|
-
version = "1.1.
|
|
20
|
+
version = "1.1.4"
|
|
21
21
|
init_file = Path(__file__).parent / "xiaoshiai_hub" / "__init__.py"
|
|
22
22
|
if init_file.exists():
|
|
23
23
|
with open(init_file, "r", encoding="utf-8") as f:
|
|
@@ -30,6 +30,7 @@ if init_file.exists():
|
|
|
30
30
|
install_requires = [
|
|
31
31
|
"requests>=2.20.0,<3.0.0",
|
|
32
32
|
"tqdm>=4.62.0,<5.0.0",
|
|
33
|
+
"cryptography>=46.0.3,<47.0.0",
|
|
33
34
|
]
|
|
34
35
|
|
|
35
36
|
# Optional dependencies
|