Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,21 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import json
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
try:
|
| 6 |
-
module =
|
| 7 |
return getattr(module, attr) if attr else module
|
| 8 |
-
except Exception:
|
| 9 |
return None
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
| 14 |
|
| 15 |
def qgtnl_process(command):
|
| 16 |
result = {
|
|
@@ -20,23 +25,27 @@ def qgtnl_process(command):
|
|
| 20 |
"status": "OK"
|
| 21 |
}
|
| 22 |
|
|
|
|
| 23 |
if TIAWorker:
|
| 24 |
try:
|
| 25 |
-
|
|
|
|
| 26 |
except Exception as e:
|
| 27 |
result["tia"] = f"TIA error: {e}"
|
| 28 |
|
|
|
|
| 29 |
if PrimeSchema:
|
| 30 |
try:
|
| 31 |
-
|
|
|
|
| 32 |
except Exception as e:
|
| 33 |
result["lineage"] = f"Lineage error: {e}"
|
| 34 |
|
| 35 |
return json.dumps(result, indent=2)
|
| 36 |
|
| 37 |
-
with gr.Blocks(
|
| 38 |
gr.Markdown("# **QGTNL Command Centre**")
|
| 39 |
-
gr.Markdown("###
|
| 40 |
|
| 41 |
with gr.Row():
|
| 42 |
cmd = gr.Textbox(label="Command Input")
|
|
@@ -52,7 +61,7 @@ with gr.Blocks(css="body { background: black; color: cyan; }") as app:
|
|
| 52 |
try:
|
| 53 |
html = HoloCommandCentre().render()
|
| 54 |
gr.HTML(html)
|
| 55 |
-
except:
|
| 56 |
gr.Markdown("Holo3D failed to load.")
|
| 57 |
|
| 58 |
-
app.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import json
|
| 3 |
+
import os
|
| 4 |
+
import importlib
|
| 5 |
|
| 6 |
+
BASE = "/app"
|
| 7 |
+
|
| 8 |
+
def load_module(module_path, attr=None):
|
| 9 |
try:
|
| 10 |
+
module = importlib.import_module(module_path)
|
| 11 |
return getattr(module, attr) if attr else module
|
| 12 |
+
except Exception as e:
|
| 13 |
return None
|
| 14 |
|
| 15 |
+
# Correct container‑safe imports
|
| 16 |
+
TIAWorker = load_module("TIA.worker", "TIAWorker")
|
| 17 |
+
PrimeSchema = load_module("citadel.primeSchema", "PrimeSchema")
|
| 18 |
+
HoloCommandCentre = load_module("citadel.holo3d.ui.commandCentre", "CommandCentre")
|
| 19 |
|
| 20 |
def qgtnl_process(command):
|
| 21 |
result = {
|
|
|
|
| 25 |
"status": "OK"
|
| 26 |
}
|
| 27 |
|
| 28 |
+
# TIA
|
| 29 |
if TIAWorker:
|
| 30 |
try:
|
| 31 |
+
worker = TIAWorker()
|
| 32 |
+
result["tia"] = worker.process(command)
|
| 33 |
except Exception as e:
|
| 34 |
result["tia"] = f"TIA error: {e}"
|
| 35 |
|
| 36 |
+
# Lineage / PrimeSchema
|
| 37 |
if PrimeSchema:
|
| 38 |
try:
|
| 39 |
+
schema = PrimeSchema()
|
| 40 |
+
result["lineage"] = schema.summarize()
|
| 41 |
except Exception as e:
|
| 42 |
result["lineage"] = f"Lineage error: {e}"
|
| 43 |
|
| 44 |
return json.dumps(result, indent=2)
|
| 45 |
|
| 46 |
+
with gr.Blocks() as app:
|
| 47 |
gr.Markdown("# **QGTNL Command Centre**")
|
| 48 |
+
gr.Markdown("### TIA • Citadel • AION • ORACLE • Holo3D")
|
| 49 |
|
| 50 |
with gr.Row():
|
| 51 |
cmd = gr.Textbox(label="Command Input")
|
|
|
|
| 61 |
try:
|
| 62 |
html = HoloCommandCentre().render()
|
| 63 |
gr.HTML(html)
|
| 64 |
+
except Exception:
|
| 65 |
gr.Markdown("Holo3D failed to load.")
|
| 66 |
|
| 67 |
+
app.launch(css="body { background: black; color: cyan; }")
|