Redact sensitive operational guidance from UI text and labels.
Browse files
README.md
CHANGED
|
@@ -6,6 +6,7 @@ python_version: "3.10"
|
|
| 6 |
app_file: app.py
|
| 7 |
pinned: false
|
| 8 |
emoji: 🧮
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
# Math Conjecture Trainer Space
|
|
@@ -26,17 +27,9 @@ This Space is the tactical operations console for `maths-conjuncture-solutions`
|
|
| 26 |
5. Apply quality gate thresholds before hub push.
|
| 27 |
6. Emit `training_summary.json` + `post_eval_report.json` and stream live telemetry in UI.
|
| 28 |
|
| 29 |
-
##
|
| 30 |
-
|
| 31 |
-
No token input is required in the UI.
|
| 32 |
-
|
| 33 |
-
Resolution order:
|
| 34 |
-
|
| 35 |
-
1. `HF_TOKEN`
|
| 36 |
-
2. `HUGGINGFACE_HUB_TOKEN`
|
| 37 |
-
3. `huggingface-api-key.json`
|
| 38 |
|
| 39 |
-
|
| 40 |
|
| 41 |
## Runtime controls
|
| 42 |
|
|
@@ -45,7 +38,7 @@ If no token is available, public dataset training still works and push is automa
|
|
| 45 |
- `Gate Min pass@1`, `Gate Min pass@k`, `Gate Min Rows`: runtime gate thresholds.
|
| 46 |
- `Live Tactical Telemetry`: real-time stage progression, runtime posture, loss sparkline, and gate/push state.
|
| 47 |
- `Runtime Terminal Log (Live)`: line-by-line subprocess stream with heartbeat events during silent phases.
|
| 48 |
-
- `
|
| 49 |
- `Force Dataset Redownload`: bypasses cached parquet files.
|
| 50 |
- `Abort Active Run`: cancels active subprocess tree.
|
| 51 |
|
|
|
|
| 6 |
app_file: app.py
|
| 7 |
pinned: false
|
| 8 |
emoji: 🧮
|
| 9 |
+
|
| 10 |
---
|
| 11 |
|
| 12 |
# Math Conjecture Trainer Space
|
|
|
|
| 27 |
5. Apply quality gate thresholds before hub push.
|
| 28 |
6. Emit `training_summary.json` + `post_eval_report.json` and stream live telemetry in UI.
|
| 29 |
|
| 30 |
+
## Access posture
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
+
Credentials and publish permissions are handled by deployment runtime settings.
|
| 33 |
|
| 34 |
## Runtime controls
|
| 35 |
|
|
|
|
| 38 |
- `Gate Min pass@1`, `Gate Min pass@k`, `Gate Min Rows`: runtime gate thresholds.
|
| 39 |
- `Live Tactical Telemetry`: real-time stage progression, runtime posture, loss sparkline, and gate/push state.
|
| 40 |
- `Runtime Terminal Log (Live)`: line-by-line subprocess stream with heartbeat events during silent phases.
|
| 41 |
+
- `Validation Mode (No Training)`: validates pipeline with `--dry-run`.
|
| 42 |
- `Force Dataset Redownload`: bypasses cached parquet files.
|
| 43 |
- `Abort Active Run`: cancels active subprocess tree.
|
| 44 |
|
app.py
CHANGED
|
@@ -293,7 +293,7 @@ TACTICAL_HEADER_HTML = """
|
|
| 293 |
<div class="ops-header-title">Maths Conjecture Solutions // Training Operations Console</div>
|
| 294 |
<div class="ops-header-tags">
|
| 295 |
<span class="ops-tag">Tactical Monochrome</span>
|
| 296 |
-
<span class="ops-tag">
|
| 297 |
<span class="ops-tag">Staged Curriculum</span>
|
| 298 |
<span class="ops-tag">Live Telemetry</span>
|
| 299 |
</div>
|
|
@@ -311,7 +311,7 @@ An autonomous training operations console for DeepSeek-Math that runs multi-stag
|
|
| 311 |
3. Execute multi-stage DeepSeek-Math curriculum fine-tuning via `scripts/train_sota.py`.
|
| 312 |
4. Run post-training evaluation with pass@k-style sampling and family-level metrics.
|
| 313 |
5. Enforce autonomous quality gates before adapter promotion/push.
|
| 314 |
-
6.
|
| 315 |
"""
|
| 316 |
|
| 317 |
|
|
@@ -931,7 +931,7 @@ def run_pipeline_core(
|
|
| 931 |
return
|
| 932 |
|
| 933 |
try:
|
| 934 |
-
token,
|
| 935 |
|
| 936 |
dataset_repo_id = validate_repo_id(dataset_repo_id, "Dataset repo")
|
| 937 |
model_repo_id = validate_repo_id(model_repo_id, "Model repo")
|
|
@@ -990,11 +990,6 @@ def run_pipeline_core(
|
|
| 990 |
"force_redownload": bool(force_redownload),
|
| 991 |
"preflight_only": bool(preflight_only),
|
| 992 |
"runtime": runtime,
|
| 993 |
-
"auth": {
|
| 994 |
-
"token_source": token_source,
|
| 995 |
-
"credentials_path": token_path,
|
| 996 |
-
"token_present": bool(token),
|
| 997 |
-
},
|
| 998 |
}
|
| 999 |
)
|
| 1000 |
|
|
@@ -1005,12 +1000,9 @@ def run_pipeline_core(
|
|
| 1005 |
f"cuda_available={runtime['cuda_available']} devices={runtime['cuda_device_count']}",
|
| 1006 |
)
|
| 1007 |
if token:
|
| 1008 |
-
append_log(log_lines,
|
| 1009 |
else:
|
| 1010 |
-
append_log(
|
| 1011 |
-
log_lines,
|
| 1012 |
-
"No HF token found. Continuing without auth; public dataset access works but hub push will be disabled.",
|
| 1013 |
-
)
|
| 1014 |
yield "\n".join(log_lines), "Validating environment", summary_text(summary)
|
| 1015 |
|
| 1016 |
if not preflight_only and not torch.cuda.is_available():
|
|
@@ -1084,7 +1076,7 @@ def run_pipeline_core(
|
|
| 1084 |
]
|
| 1085 |
if preflight_only:
|
| 1086 |
train_cmd.append("--dry-run")
|
| 1087 |
-
append_log(log_lines, "
|
| 1088 |
|
| 1089 |
train_gen = stream_subprocess(
|
| 1090 |
cmd=train_cmd,
|
|
@@ -1120,7 +1112,7 @@ def run_pipeline_core(
|
|
| 1120 |
if preflight_only:
|
| 1121 |
summary["result"] = "preflight_passed"
|
| 1122 |
summary["finished_at_utc"] = now_ts()
|
| 1123 |
-
append_log(log_lines, "
|
| 1124 |
yield "\n".join(log_lines), "Preflight complete", summary_text(summary)
|
| 1125 |
return
|
| 1126 |
|
|
@@ -1346,7 +1338,7 @@ with gr.Blocks(title="Math Conjecture Trainer Space") as demo:
|
|
| 1346 |
with gr.Row():
|
| 1347 |
push_to_hub = gr.Checkbox(label="Push Adapter to Hub", value=True)
|
| 1348 |
force_redownload = gr.Checkbox(label="Force Dataset Redownload", value=False)
|
| 1349 |
-
preflight_only = gr.Checkbox(label="
|
| 1350 |
|
| 1351 |
with gr.Row():
|
| 1352 |
run_button = gr.Button("Execute Training Run", variant="primary")
|
|
|
|
| 293 |
<div class="ops-header-title">Maths Conjecture Solutions // Training Operations Console</div>
|
| 294 |
<div class="ops-header-tags">
|
| 295 |
<span class="ops-tag">Tactical Monochrome</span>
|
| 296 |
+
<span class="ops-tag">Controlled Ops</span>
|
| 297 |
<span class="ops-tag">Staged Curriculum</span>
|
| 298 |
<span class="ops-tag">Live Telemetry</span>
|
| 299 |
</div>
|
|
|
|
| 311 |
3. Execute multi-stage DeepSeek-Math curriculum fine-tuning via `scripts/train_sota.py`.
|
| 312 |
4. Run post-training evaluation with pass@k-style sampling and family-level metrics.
|
| 313 |
5. Enforce autonomous quality gates before adapter promotion/push.
|
| 314 |
+
6. Stream live terminal telemetry, tactical visualization, and structured run summaries.
|
| 315 |
"""
|
| 316 |
|
| 317 |
|
|
|
|
| 931 |
return
|
| 932 |
|
| 933 |
try:
|
| 934 |
+
token, _, _ = resolve_hf_token()
|
| 935 |
|
| 936 |
dataset_repo_id = validate_repo_id(dataset_repo_id, "Dataset repo")
|
| 937 |
model_repo_id = validate_repo_id(model_repo_id, "Model repo")
|
|
|
|
| 990 |
"force_redownload": bool(force_redownload),
|
| 991 |
"preflight_only": bool(preflight_only),
|
| 992 |
"runtime": runtime,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 993 |
}
|
| 994 |
)
|
| 995 |
|
|
|
|
| 1000 |
f"cuda_available={runtime['cuda_available']} devices={runtime['cuda_device_count']}",
|
| 1001 |
)
|
| 1002 |
if token:
|
| 1003 |
+
append_log(log_lines, "Environment posture validated.")
|
| 1004 |
else:
|
| 1005 |
+
append_log(log_lines, "Restricted mode active. Hub publish disabled for this run.")
|
|
|
|
|
|
|
|
|
|
| 1006 |
yield "\n".join(log_lines), "Validating environment", summary_text(summary)
|
| 1007 |
|
| 1008 |
if not preflight_only and not torch.cuda.is_available():
|
|
|
|
| 1076 |
]
|
| 1077 |
if preflight_only:
|
| 1078 |
train_cmd.append("--dry-run")
|
| 1079 |
+
append_log(log_lines, "Validation mode enabled: running dry validation without full training.")
|
| 1080 |
|
| 1081 |
train_gen = stream_subprocess(
|
| 1082 |
cmd=train_cmd,
|
|
|
|
| 1112 |
if preflight_only:
|
| 1113 |
summary["result"] = "preflight_passed"
|
| 1114 |
summary["finished_at_utc"] = now_ts()
|
| 1115 |
+
append_log(log_lines, "Validation mode completed successfully.")
|
| 1116 |
yield "\n".join(log_lines), "Preflight complete", summary_text(summary)
|
| 1117 |
return
|
| 1118 |
|
|
|
|
| 1338 |
with gr.Row():
|
| 1339 |
push_to_hub = gr.Checkbox(label="Push Adapter to Hub", value=True)
|
| 1340 |
force_redownload = gr.Checkbox(label="Force Dataset Redownload", value=False)
|
| 1341 |
+
preflight_only = gr.Checkbox(label="Validation Mode (No Training)", value=False)
|
| 1342 |
|
| 1343 |
with gr.Row():
|
| 1344 |
run_button = gr.Button("Execute Training Run", variant="primary")
|