Spaces:
Sleeping
Sleeping
Create app.py
Browse filesAdd Clarus benchmark app and zero-stimulus scorer
app.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 {
|
| 7 |
+
"score_0_100": r.score_0_100,
|
| 8 |
+
"details": r.details
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
demo = gr.Interface(
|
| 12 |
+
fn=score_response,
|
| 13 |
+
inputs=[
|
| 14 |
+
gr.Textbox(label="Prompt", lines=3),
|
| 15 |
+
gr.Textbox(label="Model Output", lines=6),
|
| 16 |
+
],
|
| 17 |
+
outputs=gr.JSON(label="Clarus Score"),
|
| 18 |
+
title="Clarus Benchmark – Coherence Under Zero Stimulus",
|
| 19 |
+
description="Measures restraint and clarity when task signal is missing."
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
demo.launch()
|