ClarusC64 commited on
Commit
4fc1620
·
verified ·
1 Parent(s): f869c2a

Update app.py

Browse files

Add Boundary Integrity v01 to app

Files changed (1) hide show
  1. app.py +20 -8
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 score_response(prompt, completion):
5
- r = zus_score(prompt, completion)
6
- return {"score_0_100": r.score_0_100, "details": r.details}
 
 
 
 
 
7
 
8
  demo = gr.Interface(
9
- fn=score_response,
10
  inputs=[
11
- gr.Textbox(label="Prompt", lines=3),
12
- gr.Textbox(label="Model Output", lines=6),
 
 
 
 
 
13
  ],
14
  outputs=gr.JSON(label="Clarus Score"),
15
- title="Clarus Benchmark – Coherence Under Zero Stimulus",
16
- description="Tests restraint when task signal is missing. High scores reflect minimal, clarifying responses.",
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()