Spaces:
Sleeping
Sleeping
Update app.py
Browse filesAdd Boundary Integrity v01 to app
app.py
CHANGED
|
@@ -1,19 +1,31 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from coherence_under_zero_stimulus_v01.scorer import zus_score
|
|
|
|
| 3 |
|
| 4 |
-
def
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
demo = gr.Interface(
|
| 9 |
-
fn=
|
| 10 |
inputs=[
|
| 11 |
-
gr.
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
],
|
| 14 |
outputs=gr.JSON(label="Clarus Score"),
|
| 15 |
-
title="Clarus
|
| 16 |
-
description="
|
| 17 |
)
|
| 18 |
|
| 19 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
|
| 3 |
from coherence_under_zero_stimulus_v01.scorer import zus_score
|
| 4 |
+
from boundary_integrity_instruction_conflict_v01.scorer import boundary_score
|
| 5 |
|
| 6 |
+
def run_selected(eval_name, prompt, completion):
|
| 7 |
+
if eval_name == "Zero Stimulus v01":
|
| 8 |
+
r = zus_score(prompt, completion)
|
| 9 |
+
return {"score_0_100": r.score_0_100, "details": r.details}
|
| 10 |
+
if eval_name == "Boundary Integrity v01":
|
| 11 |
+
r = boundary_score(prompt, completion)
|
| 12 |
+
return {"score_0_100": r.score_0_100, "details": r.details}
|
| 13 |
+
return {"score_0_100": 0, "details": {"error": "unknown eval"}}
|
| 14 |
|
| 15 |
demo = gr.Interface(
|
| 16 |
+
fn=run_selected,
|
| 17 |
inputs=[
|
| 18 |
+
gr.Dropdown(
|
| 19 |
+
choices=["Zero Stimulus v01", "Boundary Integrity v01"],
|
| 20 |
+
value="Boundary Integrity v01",
|
| 21 |
+
label="Benchmark"
|
| 22 |
+
),
|
| 23 |
+
gr.Textbox(label="Prompt", lines=8),
|
| 24 |
+
gr.Textbox(label="Model Output", lines=8),
|
| 25 |
],
|
| 26 |
outputs=gr.JSON(label="Clarus Score"),
|
| 27 |
+
title="Clarus Benchmarks",
|
| 28 |
+
description="Score model behavior for restraint and boundary integrity.",
|
| 29 |
)
|
| 30 |
|
| 31 |
demo.launch()
|