Spaces:
Sleeping
Sleeping
Update interface.py
Browse files- interface.py +68 -40
interface.py
CHANGED
|
@@ -98,46 +98,74 @@ def forge_agent(parent_id, new_id, collapse_torque, emotional_resonance, tier_dr
|
|
| 98 |
|
| 99 |
# --- Validation Stages Dispatcher ---
|
| 100 |
def run_stage(stage_name, mode, epochs, batch, lr):
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
|
| 142 |
# --- Gradio Interface ---
|
| 143 |
with gr.Blocks(theme="soft") as demo:
|
|
|
|
| 98 |
|
| 99 |
# --- Validation Stages Dispatcher ---
|
| 100 |
def run_stage(stage_name, mode, epochs, batch, lr):
|
| 101 |
+
try:
|
| 102 |
+
if stage_name == "Stage 1 — CIFAR-10 Baseline":
|
| 103 |
+
stage1.train(mode=mode, epochs=int(epochs), batch=int(batch), lr=float(lr),
|
| 104 |
+
log_path="stage1_cifar10_log.jsonl")
|
| 105 |
+
return "✅ Stage 1 complete. Log saved to stage1_cifar10_log.jsonl"
|
| 106 |
+
|
| 107 |
+
elif stage_name == "Stage 2 — Orbital & Agent Coupling":
|
| 108 |
+
stage2.train(mode=mode, steps=int(epochs), n=int(batch), r0=0.165,
|
| 109 |
+
log_path="stage2_agents.jsonl")
|
| 110 |
+
return "✅ Stage 2 complete. Log saved to stage2_agents.jsonl"
|
| 111 |
+
|
| 112 |
+
elif stage_name == "Stage 3 — Unified Telemetry":
|
| 113 |
+
stage3.train(mode=mode, steps=int(epochs), batch=int(batch),
|
| 114 |
+
log_path="stage3_telemetry.jsonl")
|
| 115 |
+
return "✅ Stage 3 complete. Log saved to stage3_telemetry.jsonl"
|
| 116 |
+
|
| 117 |
+
elif stage_name == "Stage 4 — ViT-Tiny (ImageNet Subset)":
|
| 118 |
+
stage4.train(mode=mode, data_dir=None, steps=int(epochs), batch=int(batch),
|
| 119 |
+
lr=float(lr), log_path="stage4_vit_tiny.jsonl")
|
| 120 |
+
return "✅ Stage 4 complete. Log saved to stage4_vit_tiny.jsonl"
|
| 121 |
+
|
| 122 |
+
elif stage_name == "Stage 5 — ViT-Small/B32 (ImageNet Subset)":
|
| 123 |
+
stage5.run(mode=mode, data_dir=None, steps=int(epochs), batch=int(batch),
|
| 124 |
+
lr=float(lr), log="stage5_vit_small_b32.jsonl")
|
| 125 |
+
return "✅ Stage 5 complete. Log saved to stage5_vit_small_b32.jsonl"
|
| 126 |
+
|
| 127 |
+
elif stage_name == "Stage 6 — ViT-Base (Full ImageNet-1K)":
|
| 128 |
+
stage6.run(mode=mode, data_dir=None, epochs=int(epochs), batch=int(batch),
|
| 129 |
+
lr=float(lr), log_path="stage6_vit_base.jsonl")
|
| 130 |
+
return "✅ Stage 6 complete. Log saved to stage6_vit_base.jsonl"
|
| 131 |
+
|
| 132 |
+
elif stage_name == "Stage 7 — CLIP Multi-Modal (Text–Image)":
|
| 133 |
+
stage7.run(mode=mode, steps=int(epochs), batch=int(batch),
|
| 134 |
+
lr=float(lr), log="stage7_clip.jsonl")
|
| 135 |
+
return "✅ Stage 7 complete. Log saved to stage7_clip.jsonl"
|
| 136 |
+
|
| 137 |
+
elif stage_name == "Stage 8 — RFT-LLM (Language-Only Transformer)":
|
| 138 |
+
stage8.run(mode=mode, steps=int(epochs), batch=int(batch),
|
| 139 |
+
lr=float(lr), log="stage8_llm.jsonl")
|
| 140 |
+
return "✅ Stage 8 complete. Log saved to stage8_llm.jsonl"
|
| 141 |
+
|
| 142 |
+
elif stage_name == "Stage 9 — Distributed LLM (DDP, 4×A100)":
|
| 143 |
+
stage9.run_ddp(mode=mode, steps=int(epochs), batch=int(batch),
|
| 144 |
+
seq=256, vocab=32768, lr=float(lr),
|
| 145 |
+
log="stage9_dist_llm.jsonl")
|
| 146 |
+
return "✅ Stage 9 complete. Log saved to stage9_dist_llm.jsonl"
|
| 147 |
+
|
| 148 |
+
elif stage_name == "Stage 10 — RFT-GPT-30B (DDP, 8×A100)":
|
| 149 |
+
stage10.run(mode=mode, steps=int(epochs), batch=int(batch),
|
| 150 |
+
seq=1024, vocab=32768, lr=float(lr),
|
| 151 |
+
log="stage10_gpt30b.jsonl")
|
| 152 |
+
return "✅ Stage 10 complete. Log saved to stage10_gpt30b.jsonl"
|
| 153 |
+
|
| 154 |
+
elif stage_name == "Stage 11 — RFT-GPT-70B (DDP, 16×A100)":
|
| 155 |
+
stage11.run(mode=mode, steps=int(epochs), batch=int(batch),
|
| 156 |
+
vocab=32768, lr=float(lr),
|
| 157 |
+
log="stage11_gpt70b.jsonl")
|
| 158 |
+
return "✅ Stage 11 complete. Log saved to stage11_gpt70b.jsonl"
|
| 159 |
+
|
| 160 |
+
elif stage_name == "Stage 12 — Production Pilot & Monitoring":
|
| 161 |
+
stage12.main()
|
| 162 |
+
return "✅ Stage 12 monitoring started."
|
| 163 |
+
|
| 164 |
+
else:
|
| 165 |
+
return "Stage not yet implemented."
|
| 166 |
+
except Exception as e:
|
| 167 |
+
return f"❌ Error running {stage_name}: {e}"
|
| 168 |
+
|
| 169 |
|
| 170 |
# --- Gradio Interface ---
|
| 171 |
with gr.Blocks(theme="soft") as demo:
|