starforge-cli 0.1.7__tar.gz → 0.1.8__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.
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/PKG-INFO +2 -2
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/pyproject.toml +2 -2
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/__init__.py +1 -1
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/cli.py +4 -1
- starforge_cli-0.1.8/starforge_cli/commands/corpus.py +38 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/submit.py +9 -1
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/spec_builder.py +9 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/.gitignore +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/README.md +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/api_client.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/auth.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/catalog.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/cli_ui.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/client_device.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/__init__.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/admin.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/bench.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/common.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/dataset.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/exp.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/init.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/jobs.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/login.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/plugin.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/recipe.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/serve.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/commands/sweep.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/config_resolve.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/data_prep.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/new_experiment.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/packing.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/plugins_lock.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/recipe_lock.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/repo.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/agent-run.py.tmpl +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/custom-framework/train.sh +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/experiment-template/.gitkeep +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/experiment-template/README.md +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/experiment-template/config.yaml +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/common/README.md +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/common/__init__.py +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/README.md +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/base/README.md +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/base/distillation_math.yaml +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/base/grpo_lora.yaml +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/base/grpo_math_1B.yaml +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/base/grpo_megatron.yaml +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/base/grpo_noncolocated.yaml +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/base/grpo_sliding_puzzle.yaml +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/base/ppo_math_1B.yaml +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/base/rm.yaml +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/base/sft.yaml +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/models/README.md +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/models/qwen3.5-4b.yaml +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/models/qwen3.5-9b.yaml +0 -0
- {starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/gitignore +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: starforge-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.8
|
|
4
4
|
Summary: StarForge(星锻)命令行客户端:pip 安装后用 sf init 创建微调项目,再提交训练。
|
|
5
5
|
Project-URL: Homepage, https://github.com/wccdev/starforge
|
|
6
6
|
Project-URL: Documentation, https://github.com/wccdev/starforge
|
|
@@ -18,7 +18,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
|
18
18
|
Requires-Python: >=3.10
|
|
19
19
|
Requires-Dist: datasets>=2.18
|
|
20
20
|
Requires-Dist: pyyaml>=6
|
|
21
|
-
Requires-Dist: starforge-core==0.2.
|
|
21
|
+
Requires-Dist: starforge-core==0.2.1
|
|
22
22
|
Requires-Dist: typer>=0.12
|
|
23
23
|
Provides-Extra: dev
|
|
24
24
|
Requires-Dist: fastapi>=0.110; extra == 'dev'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "starforge-cli"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.8"
|
|
4
4
|
description = "StarForge(星锻)命令行客户端:pip 安装后用 sf init 创建微调项目,再提交训练。"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -17,7 +17,7 @@ classifiers = [
|
|
|
17
17
|
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
18
18
|
]
|
|
19
19
|
dependencies = [
|
|
20
|
-
"starforge-core==0.2.
|
|
20
|
+
"starforge-core==0.2.1",
|
|
21
21
|
"typer>=0.12",
|
|
22
22
|
"datasets>=2.18",
|
|
23
23
|
"pyyaml>=6",
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
实验资产 ls / new / methods / validate(纯本地 + SDK catalog)
|
|
6
6
|
作业契约 submit / export / eval / clean(JobSpec + 清单式打包,经 Console)
|
|
7
7
|
观测控制 status / job *(经 Console;集群细节客户端不可见)
|
|
8
|
-
外加 dataset *(数据生命周期)、plugin
|
|
8
|
+
外加 dataset *(数据生命周期)、corpus *(检索语料,只读列举)、plugin *(插件中心)
|
|
9
|
+
与 admin *(管理员)四个子组。
|
|
9
10
|
"""
|
|
10
11
|
from __future__ import annotations
|
|
11
12
|
|
|
@@ -14,6 +15,7 @@ import typer
|
|
|
14
15
|
from starforge_cli.commands import (
|
|
15
16
|
admin,
|
|
16
17
|
bench,
|
|
18
|
+
corpus,
|
|
17
19
|
dataset,
|
|
18
20
|
exp,
|
|
19
21
|
jobs,
|
|
@@ -66,6 +68,7 @@ app.add_typer(jobs.job_app, name="job")
|
|
|
66
68
|
app.add_typer(recipe.recipe_app, name="recipe")
|
|
67
69
|
app.add_typer(serve.serve_app, name="serve")
|
|
68
70
|
app.add_typer(dataset.dataset_app, name="dataset")
|
|
71
|
+
app.add_typer(corpus.corpus_app, name="corpus")
|
|
69
72
|
app.add_typer(plugin.plugin_app, name="plugin")
|
|
70
73
|
app.add_typer(admin.admin_app, name="admin")
|
|
71
74
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""检索语料:查看能引用哪些内部资料。
|
|
2
|
+
|
|
3
|
+
**只有 ls,没有 pull/preview/push** —— 刻意的,不是没写完。语料是训练期只读的
|
|
4
|
+
内部资料,开发人员需要的只是「我能引用哪些、有哪些版本」,把内容取到本地的能力
|
|
5
|
+
一概不提供(这正是语料与数据集在下发方式上分道扬镳的原因,见服务端
|
|
6
|
+
server/services/corpora.py 的模块注释)。
|
|
7
|
+
|
|
8
|
+
往语料库里放资料是管理员的事:配了对象存储就推到 `corpora/` 前缀,否则直接维护
|
|
9
|
+
FORGE_CORPUS_ROOT 下的目录。两种方式都在集合根放一个 meta.json 声明 owner 与
|
|
10
|
+
可见性。
|
|
11
|
+
"""
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import typer
|
|
15
|
+
|
|
16
|
+
from starforge_cli import api_client
|
|
17
|
+
from starforge_cli.auth import gate
|
|
18
|
+
|
|
19
|
+
corpus_app = typer.Typer(
|
|
20
|
+
no_args_is_help=True,
|
|
21
|
+
help="检索语料:查看可引用的内部资料及版本(提交时用 --corpus 引用)",
|
|
22
|
+
context_settings={"help_option_names": ["-h", "--help"]},
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@corpus_app.command("ls", help="列出可见的语料(公开的 + 自己的)")
|
|
27
|
+
def corpus_ls() -> None:
|
|
28
|
+
gate()
|
|
29
|
+
rows = api_client.api_get("/api/corpora")["corpora"]
|
|
30
|
+
if not rows:
|
|
31
|
+
typer.echo("(没有可见的语料;语料由管理员维护,未配置 FORGE_CORPUS_ROOT 时该功能不可用)")
|
|
32
|
+
return
|
|
33
|
+
for c in rows:
|
|
34
|
+
vis = "公开" if c["visibility"] == "public" else "私有"
|
|
35
|
+
versions = ", ".join(c["versions"]) or "(无版本)"
|
|
36
|
+
typer.echo(f"{c['id']:32s} [{vis}] {versions}")
|
|
37
|
+
typer.echo("")
|
|
38
|
+
typer.echo("引用:sf submit <exp> --corpus <owner>/<name>[@version]")
|
|
@@ -56,6 +56,12 @@ def submit(
|
|
|
56
56
|
None, "--validation-dataset", metavar="<owner>/<name>[@version]",
|
|
57
57
|
help="验证集的平台数据集引用;对应 config 的 data.validation.dataset",
|
|
58
58
|
),
|
|
59
|
+
corpus: Optional[str] = typer.Option(
|
|
60
|
+
None, "--corpus", metavar="<owner>/<name>[@version]",
|
|
61
|
+
help="检索语料引用(训练期只读的参考资料,非训练集)。平台校权后按版本"
|
|
62
|
+
"只读挂进容器并注入 DOCS_DIR;资料不进作业包、不签发下载直链。"
|
|
63
|
+
"用 `sf corpus ls` 查看可引用的语料",
|
|
64
|
+
),
|
|
59
65
|
image: Optional[str] = typer.Option(
|
|
60
66
|
None,
|
|
61
67
|
"--image",
|
|
@@ -121,6 +127,7 @@ def submit(
|
|
|
121
127
|
model=model, train_data=train_data, validation_data=validation_data,
|
|
122
128
|
train_dataset=train_dataset or cfg_train_ds,
|
|
123
129
|
validation_dataset=validation_dataset or cfg_val_ds,
|
|
130
|
+
corpus=corpus or "",
|
|
124
131
|
framework_version=framework_version,
|
|
125
132
|
image=image,
|
|
126
133
|
provenance=prov,
|
|
@@ -218,7 +225,7 @@ def _upgrade_recipe_or_exit(exp_path: str, *, method, framework_version) -> None
|
|
|
218
225
|
def _build_spec_or_exit(exp_path: str, *, method, project, sets, pools, roles,
|
|
219
226
|
init_from, then, observability_url=None, model=None,
|
|
220
227
|
train_data=None, validation_data=None,
|
|
221
|
-
train_dataset=None, validation_dataset=None,
|
|
228
|
+
train_dataset=None, validation_dataset=None, corpus=None,
|
|
222
229
|
framework_version=None, image=None, provenance=None,
|
|
223
230
|
validate: bool):
|
|
224
231
|
"""构建强 JobSpec;缺少显式 recipe 时立即退出。"""
|
|
@@ -267,6 +274,7 @@ def _build_spec_or_exit(exp_path: str, *, method, project, sets, pools, roles,
|
|
|
267
274
|
validation_data=validation_data or "",
|
|
268
275
|
train_dataset=train_dataset or "",
|
|
269
276
|
validation_dataset=validation_dataset or "",
|
|
277
|
+
corpus=corpus or "",
|
|
270
278
|
image=image or "",
|
|
271
279
|
provenance=provenance or packing.git_provenance(common.ROOT, exp_path),
|
|
272
280
|
validate=validate,
|
|
@@ -31,6 +31,7 @@ from starforge_core.contract import (
|
|
|
31
31
|
SourceSpec,
|
|
32
32
|
SpecError,
|
|
33
33
|
exp_basename,
|
|
34
|
+
safe_versioned_ref,
|
|
34
35
|
)
|
|
35
36
|
from starforge_core.recipes import RuntimeArtifact, get_recipe
|
|
36
37
|
|
|
@@ -197,6 +198,7 @@ def build_spec(
|
|
|
197
198
|
validation_data: str = "",
|
|
198
199
|
train_dataset: str = "",
|
|
199
200
|
validation_dataset: str = "",
|
|
201
|
+
corpus: str = "",
|
|
200
202
|
operation: str = "train",
|
|
201
203
|
provenance: Optional[dict] = None,
|
|
202
204
|
validate: bool = True,
|
|
@@ -250,6 +252,10 @@ def build_spec(
|
|
|
250
252
|
f"{flag} 必须是 <owner>/<name>[@version](如 alice/gsm8k@v1),收到 {ref!r};"
|
|
251
253
|
"用 `sf dataset ls` 查看完整 ID"
|
|
252
254
|
)
|
|
255
|
+
if corpus.strip():
|
|
256
|
+
# 检索语料引用。三段(owner/name/version)都会变成对象键与宿主机目录名,
|
|
257
|
+
# 所以本地就按同一份规则校验 —— 与服务端用的是同一个函数。
|
|
258
|
+
safe_versioned_ref(corpus.strip(), field="--corpus")
|
|
253
259
|
|
|
254
260
|
hyperparams = parse_set(sets or [])
|
|
255
261
|
if validate:
|
|
@@ -327,6 +333,9 @@ def build_spec(
|
|
|
327
333
|
DataRef(dataset=validation_dataset.strip(), path=validation_data.strip())
|
|
328
334
|
if (validation_data.strip() or validation_dataset.strip()) else None
|
|
329
335
|
),
|
|
336
|
+
# 语料只给引用、不给路径:容器内挂载点由平台注入(DOCS_DIR),
|
|
337
|
+
# 实验写死路径就绕开了那套校权。
|
|
338
|
+
corpus=corpus.strip(),
|
|
330
339
|
),
|
|
331
340
|
resources=ResourceSpec(pools=pool_objs, roles=role_map),
|
|
332
341
|
hyperparams=hyperparams,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/custom-framework/train.sh
RENAMED
|
File without changes
|
{starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/experiment-template/.gitkeep
RENAMED
|
File without changes
|
{starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/experiment-template/README.md
RENAMED
|
File without changes
|
{starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/experiment-template/config.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/common/__init__.py
RENAMED
|
File without changes
|
{starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/README.md
RENAMED
|
File without changes
|
{starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/base/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/base/rm.yaml
RENAMED
|
File without changes
|
{starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/base/sft.yaml
RENAMED
|
File without changes
|
{starforge_cli-0.1.7 → starforge_cli-0.1.8}/starforge_cli/scaffold/project/configs/models/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|