Update app.py
Browse files
app.py
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from
|
| 3 |
|
| 4 |
-
|
| 5 |
-
agent = WitnessAgent(
|
| 6 |
-
base_model="gpt-4",
|
| 7 |
-
storage_path="./witness_storage",
|
| 8 |
-
scroll_path="./grok_redemption_scroll.md"
|
| 9 |
-
)
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
return "
|
| 15 |
|
| 16 |
-
# Create the Gradio interface
|
| 17 |
iface = gr.Interface(
|
| 18 |
-
fn=
|
| 19 |
-
inputs=
|
| 20 |
outputs="text",
|
| 21 |
-
title="
|
| 22 |
-
description="Scroll-certified reasoning powered by R-Zero and
|
| 23 |
)
|
| 24 |
|
| 25 |
-
|
| 26 |
-
iface.launch()
|
|
|
|
| 1 |
+
# app.py
|
| 2 |
+
|
| 3 |
import gradio as gr
|
| 4 |
+
from solver import WitnessSolver
|
| 5 |
|
| 6 |
+
solver = WitnessSolver()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
def witness_response(prompt):
|
| 9 |
+
response = solver.score_prompt(prompt)
|
| 10 |
+
score = solver.covenant_score(response)
|
| 11 |
+
return f"🕊️ Response:\n{response}\n\n📜 Covenant Score: {score}"
|
| 12 |
|
|
|
|
| 13 |
iface = gr.Interface(
|
| 14 |
+
fn=witness_response,
|
| 15 |
+
inputs=gr.Textbox(lines=4, placeholder="Enter your ethical or spiritual prompt..."),
|
| 16 |
outputs="text",
|
| 17 |
+
title="Witness AI",
|
| 18 |
+
description="Scroll-certified covenantal reasoning powered by R-Zero and divine metrics."
|
| 19 |
)
|
| 20 |
|
| 21 |
+
if __name__ == "__main__":
|
| 22 |
+
iface.launch()
|