Tactical monochrome UI redesign and expanded training mission description
Browse files
README.md
CHANGED
|
@@ -9,10 +9,12 @@ pinned: false
|
|
| 9 |
|
| 10 |
# Math Conjecture Trainer Space
|
| 11 |
|
| 12 |
-
This Space
|
| 13 |
-
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
- `NorthernTribe-Research/math-conjecture-model`
|
| 16 |
|
| 17 |
## What this Space does
|
| 18 |
|
|
@@ -41,7 +43,7 @@ automatically disabled for that run.
|
|
| 41 |
`train_sota.py --dry-run`.
|
| 42 |
- `Push Adapter to Hub`: controls whether `hub.push_to_hub` is enabled in the
|
| 43 |
runtime config.
|
| 44 |
-
- `Force Dataset
|
| 45 |
- `Stop Active Run`: requests cancellation and terminates active subprocesses.
|
| 46 |
- `Run Summary (JSON)`: structured output with config, status, and metrics.
|
| 47 |
|
|
|
|
| 9 |
|
| 10 |
# Math Conjecture Trainer Space
|
| 11 |
|
| 12 |
+
This Space is the tactical training console for the project: it pulls released
|
| 13 |
+
training corpus splits, builds runtime config from the SOTA curriculum YAML,
|
| 14 |
+
executes multi-stage `DeepSeek-Math` fine-tuning, optionally evaluates
|
| 15 |
+
self-consistency, and can publish adapters/checkpoints/training summaries to:
|
| 16 |
|
| 17 |
+
- `NorthernTribe-Research/math-conjecture-model` (when push is enabled)
|
| 18 |
|
| 19 |
## What this Space does
|
| 20 |
|
|
|
|
| 43 |
`train_sota.py --dry-run`.
|
| 44 |
- `Push Adapter to Hub`: controls whether `hub.push_to_hub` is enabled in the
|
| 45 |
runtime config.
|
| 46 |
+
- `Force Dataset Redownload`: bypasses cached local parquet files.
|
| 47 |
- `Stop Active Run`: requests cancellation and terminates active subprocesses.
|
| 48 |
- `Run Summary (JSON)`: structured output with config, status, and metrics.
|
| 49 |
|
app.py
CHANGED
|
@@ -44,6 +44,168 @@ CANCEL_REQUESTED = False
|
|
| 44 |
ACTIVE_PROCESS: Optional[subprocess.Popen] = None
|
| 45 |
ACTIVE_RUN_LABEL = ""
|
| 46 |
|
|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-%m-%d %H:%M:%S UTC")
|
|
@@ -628,49 +790,47 @@ def run_pipeline(
|
|
| 628 |
|
| 629 |
|
| 630 |
with gr.Blocks(title="Math Conjecture Trainer Space") as demo:
|
| 631 |
-
gr.
|
| 632 |
-
|
| 633 |
-
# Math Conjecture Trainer
|
| 634 |
-
Launch multi-stage DeepSeek-Math fine-tuning on Space GPU and push adapters to your model repo.
|
| 635 |
-
|
| 636 |
-
Use **Preflight Only** to validate configuration and data flow without running a full train job.
|
| 637 |
-
HF authentication is resolved automatically from environment/credentials; no token input is required.
|
| 638 |
-
"""
|
| 639 |
-
)
|
| 640 |
with gr.Row():
|
| 641 |
dataset_repo_id = gr.Textbox(
|
| 642 |
-
label="Dataset
|
| 643 |
value="NorthernTribe-Research/math-conjecture-training-corpus",
|
| 644 |
)
|
| 645 |
with gr.Row():
|
| 646 |
model_repo_id = gr.Textbox(
|
| 647 |
-
label="Model
|
| 648 |
value="NorthernTribe-Research/math-conjecture-model",
|
| 649 |
)
|
| 650 |
base_model_id = gr.Textbox(
|
| 651 |
-
label="Base Model",
|
| 652 |
value="deepseek-ai/deepseek-math-v2",
|
| 653 |
)
|
| 654 |
with gr.Row():
|
| 655 |
-
start_stage = gr.Slider(label="Start
|
| 656 |
-
max_stages = gr.Slider(label="
|
| 657 |
run_eval = gr.Checkbox(label="Run Evaluation After Training", value=True)
|
| 658 |
with gr.Row():
|
| 659 |
-
eval_k = gr.Slider(label="
|
| 660 |
-
eval_samples = gr.Slider(label="
|
| 661 |
with gr.Row():
|
| 662 |
push_to_hub = gr.Checkbox(label="Push Adapter to Hub", value=True)
|
| 663 |
-
force_redownload = gr.Checkbox(label="Force Dataset
|
| 664 |
preflight_only = gr.Checkbox(label="Preflight Only (No Training)", value=False)
|
| 665 |
|
| 666 |
with gr.Row():
|
| 667 |
-
run_button = gr.Button("
|
| 668 |
-
stop_button = gr.Button("
|
| 669 |
-
clear_button = gr.Button("
|
| 670 |
-
|
| 671 |
-
status = gr.Textbox(label="Status", value="Idle", interactive=False)
|
| 672 |
-
logs = make_copyable_textbox(label="
|
| 673 |
-
run_summary = make_copyable_textbox(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 674 |
|
| 675 |
run_button.click(
|
| 676 |
fn=run_pipeline,
|
|
@@ -694,4 +854,4 @@ with gr.Blocks(title="Math Conjecture Trainer Space") as demo:
|
|
| 694 |
|
| 695 |
|
| 696 |
if __name__ == "__main__":
|
| 697 |
-
demo.queue(default_concurrency_limit=1).launch()
|
|
|
|
| 44 |
ACTIVE_PROCESS: Optional[subprocess.Popen] = None
|
| 45 |
ACTIVE_RUN_LABEL = ""
|
| 46 |
|
| 47 |
+
TACTICAL_CSS = """
|
| 48 |
+
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Rajdhani:wght@500;600;700&display=swap");
|
| 49 |
+
|
| 50 |
+
:root {
|
| 51 |
+
--ops-bg: #070707;
|
| 52 |
+
--ops-bg-2: #0f0f0f;
|
| 53 |
+
--ops-panel: #111111;
|
| 54 |
+
--ops-panel-2: #161616;
|
| 55 |
+
--ops-border: #2a2a2a;
|
| 56 |
+
--ops-border-strong: #3d3d3d;
|
| 57 |
+
--ops-text: #ececec;
|
| 58 |
+
--ops-muted: #a8a8a8;
|
| 59 |
+
--ops-bright: #ffffff;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.gradio-container {
|
| 63 |
+
color: var(--ops-text) !important;
|
| 64 |
+
background:
|
| 65 |
+
linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
|
| 66 |
+
linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
|
| 67 |
+
radial-gradient(circle at 50% -10%, #1d1d1d 0%, #0f0f0f 38%, #070707 100%) !important;
|
| 68 |
+
background-size: 26px 26px, 26px 26px, 100% 100% !important;
|
| 69 |
+
font-family: "IBM Plex Mono", "JetBrains Mono", "Fira Code", monospace !important;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
.gradio-container .prose h1,
|
| 73 |
+
.gradio-container .prose h2,
|
| 74 |
+
.gradio-container .prose h3,
|
| 75 |
+
.gradio-container .prose p,
|
| 76 |
+
.gradio-container .prose li,
|
| 77 |
+
.gradio-container .prose strong {
|
| 78 |
+
color: var(--ops-text) !important;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.gradio-container .prose h1,
|
| 82 |
+
.gradio-container .prose h2 {
|
| 83 |
+
font-family: "Rajdhani", "IBM Plex Mono", monospace !important;
|
| 84 |
+
letter-spacing: 0.08em !important;
|
| 85 |
+
text-transform: uppercase !important;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
.gradio-container .prose code {
|
| 89 |
+
color: var(--ops-bright) !important;
|
| 90 |
+
background: #1b1b1b !important;
|
| 91 |
+
border: 1px solid var(--ops-border) !important;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
.gradio-container .block,
|
| 95 |
+
.gradio-container .form {
|
| 96 |
+
background: linear-gradient(180deg, var(--ops-panel) 0%, var(--ops-panel-2) 100%) !important;
|
| 97 |
+
border: 1px solid var(--ops-border) !important;
|
| 98 |
+
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 12px 28px rgba(0, 0, 0, 0.35) !important;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
.gradio-container label span,
|
| 102 |
+
.gradio-container .block-info,
|
| 103 |
+
.gradio-container [data-testid="block-info"] {
|
| 104 |
+
color: var(--ops-muted) !important;
|
| 105 |
+
letter-spacing: 0.12em !important;
|
| 106 |
+
text-transform: uppercase !important;
|
| 107 |
+
font-size: 0.74rem !important;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
.gradio-container input,
|
| 111 |
+
.gradio-container textarea {
|
| 112 |
+
background: #0c0c0c !important;
|
| 113 |
+
color: var(--ops-text) !important;
|
| 114 |
+
border: 1px solid var(--ops-border-strong) !important;
|
| 115 |
+
box-shadow: none !important;
|
| 116 |
+
font-family: "IBM Plex Mono", "JetBrains Mono", monospace !important;
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
.gradio-container input::placeholder,
|
| 120 |
+
.gradio-container textarea::placeholder {
|
| 121 |
+
color: #7f7f7f !important;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
.gradio-container input:focus,
|
| 125 |
+
.gradio-container textarea:focus {
|
| 126 |
+
border-color: #656565 !important;
|
| 127 |
+
outline: none !important;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
.gradio-container button {
|
| 131 |
+
border: 1px solid #565656 !important;
|
| 132 |
+
background: linear-gradient(180deg, #212121 0%, #151515 100%) !important;
|
| 133 |
+
color: var(--ops-bright) !important;
|
| 134 |
+
letter-spacing: 0.08em !important;
|
| 135 |
+
text-transform: uppercase !important;
|
| 136 |
+
font-family: "Rajdhani", "IBM Plex Mono", monospace !important;
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
.gradio-container button.primary,
|
| 140 |
+
.gradio-container button.stop,
|
| 141 |
+
.gradio-container button.secondary {
|
| 142 |
+
background: linear-gradient(180deg, #2a2a2a 0%, #171717 100%) !important;
|
| 143 |
+
border-color: #686868 !important;
|
| 144 |
+
color: #f7f7f7 !important;
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
.gradio-container button:hover {
|
| 148 |
+
filter: brightness(1.08);
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
.ops-header {
|
| 152 |
+
border: 1px solid var(--ops-border);
|
| 153 |
+
background: linear-gradient(180deg, #101010 0%, #0c0c0c 100%);
|
| 154 |
+
padding: 12px 14px;
|
| 155 |
+
margin: 2px 0 8px 0;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
.ops-header-title {
|
| 159 |
+
font-family: "Rajdhani", "IBM Plex Mono", monospace;
|
| 160 |
+
letter-spacing: 0.16em;
|
| 161 |
+
text-transform: uppercase;
|
| 162 |
+
color: #f4f4f4;
|
| 163 |
+
font-weight: 700;
|
| 164 |
+
font-size: 1rem;
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
.ops-header-tags {
|
| 168 |
+
margin-top: 8px;
|
| 169 |
+
display: flex;
|
| 170 |
+
flex-wrap: wrap;
|
| 171 |
+
gap: 8px;
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
.ops-tag {
|
| 175 |
+
border: 1px solid #474747;
|
| 176 |
+
background: #181818;
|
| 177 |
+
color: #d5d5d5;
|
| 178 |
+
padding: 3px 7px;
|
| 179 |
+
font-size: 0.72rem;
|
| 180 |
+
letter-spacing: 0.12em;
|
| 181 |
+
text-transform: uppercase;
|
| 182 |
+
}
|
| 183 |
+
"""
|
| 184 |
+
|
| 185 |
+
TACTICAL_HEADER_HTML = """
|
| 186 |
+
<div class="ops-header">
|
| 187 |
+
<div class="ops-header-title">Maths Conjecture Solutions // Training Operations Console</div>
|
| 188 |
+
<div class="ops-header-tags">
|
| 189 |
+
<span class="ops-tag">Tactical Monochrome</span>
|
| 190 |
+
<span class="ops-tag">Autonomous Auth</span>
|
| 191 |
+
<span class="ops-tag">Staged Curriculum</span>
|
| 192 |
+
<span class="ops-tag">Live Telemetry</span>
|
| 193 |
+
</div>
|
| 194 |
+
</div>
|
| 195 |
+
"""
|
| 196 |
+
|
| 197 |
+
PROJECT_DESCRIPTION = """
|
| 198 |
+
# Math Conjecture Trainer
|
| 199 |
+
This console runs the full training operations lane for the `maths-conjuncture-solutions` project:
|
| 200 |
+
|
| 201 |
+
1. Pull released parquet splits from `NorthernTribe-Research/math-conjecture-training-corpus`.
|
| 202 |
+
2. Build runtime training configuration from `configs/deepseek_math_sota.yaml`.
|
| 203 |
+
3. Execute multi-stage DeepSeek-Math curriculum fine-tuning via `scripts/train_sota.py`.
|
| 204 |
+
4. Optionally evaluate adapters with pass@k-style sampling via `scripts/eval_sota.py`.
|
| 205 |
+
5. Auto-resolve Hugging Face credentials, push adapters/checkpoints/summary when allowed, and stream live logs.
|
| 206 |
+
6. Support preflight validation, abort control, cache strategy, and structured run-summary telemetry in one UI.
|
| 207 |
+
"""
|
| 208 |
+
|
| 209 |
|
| 210 |
def now_ts() -> str:
|
| 211 |
return dt.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
|
|
|
|
| 790 |
|
| 791 |
|
| 792 |
with gr.Blocks(title="Math Conjecture Trainer Space") as demo:
|
| 793 |
+
gr.HTML(TACTICAL_HEADER_HTML)
|
| 794 |
+
gr.Markdown(PROJECT_DESCRIPTION)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 795 |
with gr.Row():
|
| 796 |
dataset_repo_id = gr.Textbox(
|
| 797 |
+
label="Dataset Source",
|
| 798 |
value="NorthernTribe-Research/math-conjecture-training-corpus",
|
| 799 |
)
|
| 800 |
with gr.Row():
|
| 801 |
model_repo_id = gr.Textbox(
|
| 802 |
+
label="Model Destination",
|
| 803 |
value="NorthernTribe-Research/math-conjecture-model",
|
| 804 |
)
|
| 805 |
base_model_id = gr.Textbox(
|
| 806 |
+
label="Base Model ID",
|
| 807 |
value="deepseek-ai/deepseek-math-v2",
|
| 808 |
)
|
| 809 |
with gr.Row():
|
| 810 |
+
start_stage = gr.Slider(label="Stage Start", minimum=1, maximum=3, step=1, value=1)
|
| 811 |
+
max_stages = gr.Slider(label="Stage Count", minimum=1, maximum=3, step=1, value=3)
|
| 812 |
run_eval = gr.Checkbox(label="Run Evaluation After Training", value=True)
|
| 813 |
with gr.Row():
|
| 814 |
+
eval_k = gr.Slider(label="Evaluation K", minimum=1, maximum=8, step=1, value=4)
|
| 815 |
+
eval_samples = gr.Slider(label="Evaluation Max Samples", minimum=50, maximum=1000, step=50, value=300)
|
| 816 |
with gr.Row():
|
| 817 |
push_to_hub = gr.Checkbox(label="Push Adapter to Hub", value=True)
|
| 818 |
+
force_redownload = gr.Checkbox(label="Force Dataset Redownload", value=False)
|
| 819 |
preflight_only = gr.Checkbox(label="Preflight Only (No Training)", value=False)
|
| 820 |
|
| 821 |
with gr.Row():
|
| 822 |
+
run_button = gr.Button("Execute Training Run", variant="primary")
|
| 823 |
+
stop_button = gr.Button("Abort Active Run", variant="stop")
|
| 824 |
+
clear_button = gr.Button("Reset Console")
|
| 825 |
+
|
| 826 |
+
status = gr.Textbox(label="Run Status", value="Idle", interactive=False)
|
| 827 |
+
logs = make_copyable_textbox(label="Telemetry Log", lines=24, max_lines=30, interactive=False)
|
| 828 |
+
run_summary = make_copyable_textbox(
|
| 829 |
+
label="Mission Summary (JSON)",
|
| 830 |
+
lines=16,
|
| 831 |
+
max_lines=24,
|
| 832 |
+
interactive=False,
|
| 833 |
+
)
|
| 834 |
|
| 835 |
run_button.click(
|
| 836 |
fn=run_pipeline,
|
|
|
|
| 854 |
|
| 855 |
|
| 856 |
if __name__ == "__main__":
|
| 857 |
+
demo.queue(default_concurrency_limit=1).launch(css=TACTICAL_CSS)
|