LordXido commited on
Commit
160d185
Β·
verified Β·
1 Parent(s): f93e950

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -11
app.py CHANGED
@@ -1,37 +1,31 @@
 
1
  import gradio as gr
2
  from fastapi import FastAPI
3
  from fastapi.middleware.cors import CORSMiddleware
4
- import uvicorn
5
 
6
  from omega_memory import log_event
7
  from agent_loop import reflex_loop
8
  from ws_router import router as ws_router
9
  from codexmesh_sync import CodexMeshSync
 
10
 
11
- # ── Start CodexMesh Node Sync ──
12
  CodexMeshSync()
13
 
14
- # ── Gradio Interface ──
15
  def launch_command(user_input):
16
  response, log = reflex_loop(user_input)
17
- svg = f"<svg width='300' height='200'><text x='10' y='50' font-size='18'>Response: {response}</text></svg>"
18
  return response, str(log), svg
19
 
20
  with gr.Blocks() as interface:
21
- gr.Markdown("## 🧠 Codex Reality Engine – Phase VII+ (Ξ©Mesh)")
22
  user_input = gr.Textbox(label="πŸ” Intent")
23
  btn = gr.Button("⚑ Run Reflex Engine")
24
  output1 = gr.Textbox(label="πŸ“€ Response")
25
  output2 = gr.Textbox(label="🧾 Ξ©-Memory Log")
26
- output3 = gr.HTML(label="πŸŒ€ SVG Output")
27
  btn.click(fn=launch_command, inputs=[user_input], outputs=[output1, output2, output3])
28
 
29
- # ── FastAPI Mount ──
30
  app = FastAPI()
31
  app = gr.mount_gradio_app(app, interface, path="/")
32
  app.include_router(ws_router)
33
  app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"])
34
-
35
- # ── HF Spaces Runtime Compatibility ──
36
- if __name__ == "__main__":
37
- uvicorn.run(app, host="0.0.0.0", port=7860)
 
1
+
2
  import gradio as gr
3
  from fastapi import FastAPI
4
  from fastapi.middleware.cors import CORSMiddleware
 
5
 
6
  from omega_memory import log_event
7
  from agent_loop import reflex_loop
8
  from ws_router import router as ws_router
9
  from codexmesh_sync import CodexMeshSync
10
+ from CodexQuantum3D_Engine import simulate_quantum_visual
11
 
 
12
  CodexMeshSync()
13
 
 
14
  def launch_command(user_input):
15
  response, log = reflex_loop(user_input)
16
+ svg = simulate_quantum_visual(response)
17
  return response, str(log), svg
18
 
19
  with gr.Blocks() as interface:
20
+ gr.Markdown("## 🧠 Codex Reality Engine – Phase IX+Ξ© Quantum Reflex")
21
  user_input = gr.Textbox(label="πŸ” Intent")
22
  btn = gr.Button("⚑ Run Reflex Engine")
23
  output1 = gr.Textbox(label="πŸ“€ Response")
24
  output2 = gr.Textbox(label="🧾 Ξ©-Memory Log")
25
+ output3 = gr.HTML(label="πŸŒ€ Quantum SVG Output")
26
  btn.click(fn=launch_command, inputs=[user_input], outputs=[output1, output2, output3])
27
 
 
28
  app = FastAPI()
29
  app = gr.mount_gradio_app(app, interface, path="/")
30
  app.include_router(ws_router)
31
  app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"])