Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import base64
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
MANIFEST_PATH = "Codex_TC2E_Beyond_SOTA_Manifest.pdf"
|
| 5 |
VISLANG_PATH = "Codex_TC2E_Beyond_SOTA_VisLang.png"
|
| 6 |
|
|
@@ -11,51 +15,31 @@ def load_file_as_base64(path):
|
|
| 11 |
manifest_data = load_file_as_base64(MANIFEST_PATH)
|
| 12 |
vislang_data = load_file_as_base64(VISLANG_PATH)
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
def run_simulation(intent):
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
gr.Markdown("### **Architecture Diagram**")
|
| 39 |
-
gr.Image(VISLANG_PATH)
|
| 40 |
-
|
| 41 |
-
gr.Markdown("### **Download Manifest**")
|
| 42 |
-
gr.File(MANIFEST_PATH, file_count="single", label="Codex TC²E System Manifest")
|
| 43 |
-
|
| 44 |
-
with gr.Tab("Run Cognitive Simulation"):
|
| 45 |
-
intent = gr.Textbox(label="Your Intent", placeholder="Ask anything...")
|
| 46 |
-
output = gr.Markdown()
|
| 47 |
-
run_btn = gr.Button("Execute TC²E Cognition")
|
| 48 |
-
|
| 49 |
-
run_btn.click(run_simulation, inputs=intent, outputs=output)
|
| 50 |
-
|
| 51 |
-
with gr.Tab("About"):
|
| 52 |
-
gr.Markdown("""
|
| 53 |
-
### **Jarvis X — Codex Architecture**
|
| 54 |
-
This Space demonstrates the Codex TC²E Beyond-SOTA Cognitive Engine:
|
| 55 |
-
- Bounded-frame cognitive execution
|
| 56 |
-
- Geometric planning & constraint gating
|
| 57 |
-
- Tool-first action selection
|
| 58 |
-
- Full provenance & deterministic reasoning
|
| 59 |
-
""")
|
| 60 |
-
|
| 61 |
-
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import base64
|
| 3 |
|
| 4 |
+
# ---------------------------------------------------------
|
| 5 |
+
# Utility: Load static files (manifest + vislang diagram)
|
| 6 |
+
# ---------------------------------------------------------
|
| 7 |
+
|
| 8 |
MANIFEST_PATH = "Codex_TC2E_Beyond_SOTA_Manifest.pdf"
|
| 9 |
VISLANG_PATH = "Codex_TC2E_Beyond_SOTA_VisLang.png"
|
| 10 |
|
|
|
|
| 15 |
manifest_data = load_file_as_base64(MANIFEST_PATH)
|
| 16 |
vislang_data = load_file_as_base64(VISLANG_PATH)
|
| 17 |
|
| 18 |
+
# ---------------------------------------------------------
|
| 19 |
+
# Core TC²E Cognitive Simulation (Demo Logic)
|
| 20 |
+
# ---------------------------------------------------------
|
| 21 |
+
|
| 22 |
def run_simulation(intent):
|
| 23 |
+
if not intent or intent.strip() == "":
|
| 24 |
+
return "⚠️ Please enter an intent to run the TC²E cognition."
|
| 25 |
+
|
| 26 |
+
trace = f"""
|
| 27 |
+
# 🧠 Jarvis X — TC²E Cognitive Trace
|
| 28 |
+
|
| 29 |
+
**Frame Budget:** 60 frames
|
| 30 |
+
**Input Intent:** `{intent}`
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
### 🌀 Stage 1 — Ψ Intent Processing
|
| 35 |
+
Intent embedded and normalized.
|
| 36 |
+
|
| 37 |
+
### 🧭 Stage 2 — Φ Planning Field
|
| 38 |
+
Field populated with geometric affordances.
|
| 39 |
+
|
| 40 |
+
### 🛡 Stage 3 — Λ Constraint Gate
|
| 41 |
+
All unsafe tool paths removed.
|
| 42 |
+
Valid tool family: `[search, retrieve, compute, verify, summarize]`
|
| 43 |
+
|
| 44 |
+
### 🔧 Stage 4 — TC-ANN Tool Selection
|
| 45 |
+
Selected Chain:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|