Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 =
|
| 18 |
return response, str(log), svg
|
| 19 |
|
| 20 |
with gr.Blocks() as interface:
|
| 21 |
-
gr.Markdown("## π§ Codex Reality Engine β Phase
|
| 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=["*"])
|
|
|
|
|
|
|
|
|
|
|
|