Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,25 +1,32 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
def
|
| 5 |
-
|
| 6 |
"commodity": commodity,
|
| 7 |
-
"physical_anchor":
|
| 8 |
-
"
|
| 9 |
}
|
| 10 |
-
return run_engine(payload)
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
inputs=[
|
| 15 |
-
gr.Dropdown(["Gold", "
|
| 16 |
-
gr.Number(
|
| 17 |
-
gr.Slider(
|
| 18 |
],
|
| 19 |
-
outputs=gr.JSON(label="
|
| 20 |
-
title="
|
| 21 |
-
description="
|
| 22 |
)
|
| 23 |
|
| 24 |
if __name__ == "__main__":
|
| 25 |
-
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from service_api import economic_snapshot
|
| 3 |
+
from byte_enforcer import enforce
|
| 4 |
+
from federation import package_for_federation
|
| 5 |
|
| 6 |
+
def run_engine(commodity, physical_anchor, reporting_lag_days):
|
| 7 |
+
request = {
|
| 8 |
"commodity": commodity,
|
| 9 |
+
"physical_anchor": physical_anchor,
|
| 10 |
+
"reporting_lag_days": reporting_lag_days,
|
| 11 |
}
|
|
|
|
| 12 |
|
| 13 |
+
snapshot = economic_snapshot(request)
|
| 14 |
+
enforced = enforce(snapshot)
|
| 15 |
+
federated = package_for_federation(enforced)
|
| 16 |
+
|
| 17 |
+
return federated
|
| 18 |
+
|
| 19 |
+
demo = gr.Interface(
|
| 20 |
+
fn=run_engine,
|
| 21 |
inputs=[
|
| 22 |
+
gr.Dropdown(["Gold", "Oil", "Copper"], label="Commodity"),
|
| 23 |
+
gr.Number(label="Physical Anchor"),
|
| 24 |
+
gr.Slider(0, 30, step=1, label="Reporting Lag (Days)"),
|
| 25 |
],
|
| 26 |
+
outputs=gr.JSON(label="Economic Proof Payload"),
|
| 27 |
+
title="Codex Economic Web Engine",
|
| 28 |
+
description="Deterministic economic execution with proof."
|
| 29 |
)
|
| 30 |
|
| 31 |
if __name__ == "__main__":
|
| 32 |
+
demo.launch()
|