Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -188,26 +188,27 @@ with gr.Tab("Overview"):
|
|
| 188 |
gr.Image(value="assets/banner.png", label="Progression (v1→v10)")
|
| 189 |
gr.Image(value="assets/glyphs.png", label="Glyphs: Ξ (foresight), ◊̃₅ (shadow), ℝ (anchor)")
|
| 190 |
|
| 191 |
-
|
| 192 |
-
with gr.Tab("Single agent (v1–v3)"):
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
|
|
|
| 211 |
run.click(run_single, inputs=[obstacle, steps], outputs=[grid_img, pr_out, err_out])
|
| 212 |
|
| 213 |
# v4 S-Equation
|
|
|
|
| 188 |
gr.Image(value="assets/banner.png", label="Progression (v1→v10)")
|
| 189 |
gr.Image(value="assets/glyphs.png", label="Glyphs: Ξ (foresight), ◊̃₅ (shadow), ℝ (anchor)")
|
| 190 |
|
| 191 |
+
with gr.Blocks(title="Minimal Selfhood Threshold") as demo:
|
| 192 |
+
with gr.Tab("Single agent (v1–v3)"):
|
| 193 |
+
obstacle = gr.Checkbox(label="Enable moving obstacle (v3)", value=True)
|
| 194 |
+
steps = gr.Slider(10, 200, value=80, step=10, label="Steps")
|
| 195 |
+
run = gr.Button("Run")
|
| 196 |
+
grid_img = gr.Image(type="pil", label="3×3 grid (gold = agent position)")
|
| 197 |
+
pr_out = gr.Number(label="Predictive rate (%)")
|
| 198 |
+
err_out = gr.Number(label="Last error")
|
| 199 |
+
|
| 200 |
+
def run_single(ob_on, T):
|
| 201 |
+
agent = MinimalSelf()
|
| 202 |
+
obs = MovingObstacle() if ob_on else None
|
| 203 |
+
for _ in range(int(T)):
|
| 204 |
+
res = agent.step(obstacle=obs)
|
| 205 |
+
mask = np.zeros((3, 3), dtype=bool)
|
| 206 |
+
i, j = int(agent.pos[1]), int(agent.pos[0])
|
| 207 |
+
mask[i, j] = True
|
| 208 |
+
img = draw_grid(3, mask, title="Single Agent", subtitle="Gold cell shows current position")
|
| 209 |
+
return img, res["predictive_rate"], res["error"]
|
| 210 |
+
|
| 211 |
+
# 👇 This must stay inside the Blocks context
|
| 212 |
run.click(run_single, inputs=[obstacle, steps], outputs=[grid_img, pr_out, err_out])
|
| 213 |
|
| 214 |
# v4 S-Equation
|