LordXido commited on
Commit
9eaaa89
·
verified ·
1 Parent(s): d288dd2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -19
app.py CHANGED
@@ -1,23 +1,29 @@
1
  import gradio as gr
2
- from codexbyte_engine import run_codexbyte
3
- from utils import load_data_sources
4
 
5
- def launch():
6
- data = load_data_sources()
7
- result = run_codexbyte(data)
8
- return result
9
 
10
- with gr.Blocks() as demo:
11
- gr.Markdown("# CodexByte ΩΞ Runtime")
12
- gr.Markdown(
13
- "Autonomous global commodities and futures harmonization engine.\n\n"
14
- "Corrects reporting lag, synthetic distortion, and supply–demand mismatch."
15
- )
 
 
 
 
 
16
 
17
- run_btn = gr.Button("Run Autonomous Harmonization")
18
- output = gr.JSON(label="CodexByte Output")
19
-
20
- run_btn.click(fn=launch, inputs=[], outputs=output)
21
-
22
- if __name__ == "__main__":
23
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
 
 
 
 
1
  import gradio as gr
2
+ from compiler import compile_codexbyte
3
+ from codexbyte_vm import CodexByteVM
4
 
5
+ vm = CodexByteVM()
 
 
 
6
 
7
+ def run_codexbyte(source: str):
8
+ try:
9
+ program = compile_codexbyte(source.strip().splitlines())
10
+ ledger = vm.run(program)
11
+ return {
12
+ "registers": vm.reg,
13
+ "memory": vm.mem,
14
+ "omega_ledger": ledger
15
+ }
16
+ except Exception as e:
17
+ return {"error": str(e)}
18
 
19
+ gr.Interface(
20
+ fn=run_codexbyte,
21
+ inputs=gr.Textbox(
22
+ lines=16,
23
+ label="CodexByte Program",
24
+ placeholder="LOAD_IMM 0 1000\nLOAD_MEM 1 0x20\nCMP 1 0\nJZ 10\nHALT"
25
+ ),
26
+ outputs=gr.JSON(label="Ω-State Proof"),
27
+ title="CodexByte ΩΞ Runtime",
28
+ description="Bytecode execution is enforcement. Execution trace is proof."
29
+ ).launch()