RFTSystems commited on
Commit
dac3503
·
verified ·
1 Parent(s): 309588c

Update interface.py

Browse files
Files changed (1) hide show
  1. 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
- if stage_name == "Stage 1 — CIFAR-10 Baseline":
102
- return stage1.train(mode=mode, epochs=int(epochs), batch=int(batch), lr=float(lr),
103
- log_path="stage1_cifar10_log.jsonl")
104
- elif stage_name == "Stage 2 — Orbital & Agent Coupling":
105
- return stage2.train(mode=mode, steps=int(epochs), n=int(batch), r0=0.165,
106
- log_path="stage2_agents.jsonl")
107
- elif stage_name == "Stage 3Unified Telemetry":
108
- return stage3.train(mode=mode, steps=int(epochs), batch=int(batch),
109
- log_path="stage3_telemetry.jsonl")
110
- elif stage_name == "Stage 4 ViT-Tiny (ImageNet Subset)":
111
- return stage4.train(mode=mode, data_dir=None, steps=int(epochs), batch=int(batch),
112
- lr=float(lr), log_path="stage4_vit_tiny.jsonl")
113
- elif stage_name == "Stage 5 — ViT-Small/B32 (ImageNet Subset)":
114
- return stage5.run(mode=mode, data_dir=None, steps=int(epochs), batch=int(batch),
115
- lr=float(lr), log="stage5_vit_small_b32.jsonl")
116
- elif stage_name == "Stage 6 — ViT-Base (Full ImageNet-1K)":
117
- return stage6.run(mode=mode, data_dir=None, epochs=int(epochs), batch=int(batch),
118
- lr=float(lr), log_path="stage6_vit_base.jsonl")
119
- elif stage_name == "Stage 7 — CLIP Multi-Modal (Text–Image)":
120
- return stage7.run(mode=mode, steps=int(epochs), batch=int(batch),
121
- lr=float(lr), log="stage7_clip.jsonl")
122
- elif stage_name == "Stage 8RFT-LLM (Language-Only Transformer)":
123
- return stage8.run(mode=mode, steps=int(epochs), batch=int(batch),
124
- lr=float(lr), log="stage8_llm.jsonl")
125
- elif stage_name == "Stage 9 Distributed LLM (DDP, 4×A100)":
126
- return stage9.run_ddp(mode=mode, steps=int(epochs), batch=int(batch),
127
- seq=256, vocab=32768, lr=float(lr),
128
- log="stage9_dist_llm.jsonl")
129
- elif stage_name == "Stage 10 — RFT-GPT-30B (DDP, 8×A100)":
130
- return stage10.run(mode=mode, steps=int(epochs), batch=int(batch),
131
- seq=1024, vocab=32768, lr=float(lr),
132
- log="stage10_gpt30b.jsonl")
133
- elif stage_name == "Stage 11 — RFT-GPT-70B (DDP, 16×A100)":
134
- return stage11.run(mode=mode, steps=int(epochs), batch=int(batch),
135
- vocab=32768, lr=float(lr),
136
- log="stage11_gpt70b.jsonl")
137
- elif stage_name == "Stage 12Production Pilot & Monitoring":
138
- return stage12.main()
139
- else:
140
- return "Stage not yet implemented."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 2Orbital & 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 5ViT-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 8RFT-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: