Spaces:
Running
Running
feat: stylistic changes + 1 more example
Browse files- app.py +22 -10
- examples.py +13 -0
- img/flow_judge_banner.png +0 -0
app.py
CHANGED
@@ -75,6 +75,8 @@ def reset_all():
|
|
75 |
# Define presets
|
76 |
EXAMPLES = get_examples()
|
77 |
|
|
|
|
|
78 |
HEADER = """<h1 align="center" style="font-family: 'Courier New', Courier, monospace;">Flow Judge Demo</h1>
|
79 |
|
80 |
<p align="center" style="font-family: 'Courier New', Courier, monospace;">
|
@@ -82,7 +84,7 @@ HEADER = """<h1 align="center" style="font-family: 'Courier New', Courier, monos
|
|
82 |
<a href="https://www.flow-ai.com/judge">Technical Report</a> |
|
83 |
<a href="https://huggingface.co/collections/flowaicom/flow-judge-v01-66e6af5fc3b3a128bde07dec">Model Weights</a> |
|
84 |
<a href="https://github.com/flowaicom/lm-evaluation-harness/tree/Flow-Judge-v0.1_evals/lm_eval/tasks/flow_judge_evals">Evaluation Code</a> |
|
85 |
-
<a href="https://github.com/flowaicom/flow-judge/tree/main/examples">
|
86 |
</strong>
|
87 |
</p>
|
88 |
|
@@ -94,17 +96,24 @@ HEADER = """<h1 align="center" style="font-family: 'Courier New', Courier, monos
|
|
94 |
with gr.Blocks() as demo:
|
95 |
model_downloaded = download_model()
|
96 |
|
97 |
-
gr.
|
98 |
-
|
|
|
|
|
|
|
|
|
99 |
with gr.Row():
|
100 |
with gr.Column(scale=1):
|
101 |
-
preset_buttons = [gr.Button(example["description"]) for example in EXAMPLES[:len(EXAMPLES)//
|
|
|
|
|
102 |
with gr.Column(scale=1):
|
103 |
-
preset_buttons += [gr.Button(example["description"]) for example in EXAMPLES[len(EXAMPLES)//
|
104 |
|
105 |
with gr.Row(equal_height=False):
|
106 |
with gr.Column(scale=1):
|
107 |
-
gr.Markdown("**
|
|
|
108 |
with gr.Group():
|
109 |
inputs_task = gr.State([])
|
110 |
new_input_name = gr.Textbox(label="Name")
|
@@ -137,7 +146,8 @@ with gr.Blocks() as demo:
|
|
137 |
)
|
138 |
|
139 |
with gr.Column(scale=1):
|
140 |
-
gr.Markdown("**
|
|
|
141 |
with gr.Group():
|
142 |
with gr.Row(equal_height=True):
|
143 |
with gr.Column(min_width=60, scale=2):
|
@@ -145,9 +155,11 @@ with gr.Blocks() as demo:
|
|
145 |
with gr.Column(scale=9):
|
146 |
output_value = gr.Textbox(label="Value", show_label=True, interactive=True, autoscroll=False, max_lines=3)
|
147 |
|
148 |
-
|
149 |
-
|
150 |
with gr.Column(scale=1):
|
|
|
|
|
|
|
151 |
with gr.Row():
|
152 |
with gr.Column(scale=1):
|
153 |
rubric_items = gr.State([])
|
@@ -184,7 +196,7 @@ with gr.Blocks() as demo:
|
|
184 |
|
185 |
with gr.Row():
|
186 |
with gr.Column(scale=1, variant="panel"):
|
187 |
-
gr.Markdown("**Evaluation**")
|
188 |
with gr.Group():
|
189 |
with gr.Row(equal_height=True):
|
190 |
with gr.Column(min_width=15, scale=1):
|
|
|
75 |
# Define presets
|
76 |
EXAMPLES = get_examples()
|
77 |
|
78 |
+
IMAGE_PATH = "./img/flow_judge_banner.png"
|
79 |
+
|
80 |
HEADER = """<h1 align="center" style="font-family: 'Courier New', Courier, monospace;">Flow Judge Demo</h1>
|
81 |
|
82 |
<p align="center" style="font-family: 'Courier New', Courier, monospace;">
|
|
|
84 |
<a href="https://www.flow-ai.com/judge">Technical Report</a> |
|
85 |
<a href="https://huggingface.co/collections/flowaicom/flow-judge-v01-66e6af5fc3b3a128bde07dec">Model Weights</a> |
|
86 |
<a href="https://github.com/flowaicom/lm-evaluation-harness/tree/Flow-Judge-v0.1_evals/lm_eval/tasks/flow_judge_evals">Evaluation Code</a> |
|
87 |
+
<a href="https://github.com/flowaicom/flow-judge/tree/main/examples">Tutorials</a>
|
88 |
</strong>
|
89 |
</p>
|
90 |
|
|
|
96 |
with gr.Blocks() as demo:
|
97 |
model_downloaded = download_model()
|
98 |
|
99 |
+
with gr.Row(equal_height=False):
|
100 |
+
with gr.Column(scale=2):
|
101 |
+
gr.Image(IMAGE_PATH, show_label=False, interactive=False, show_share_button=False, show_fullscreen_button=False, show_download_button=False)
|
102 |
+
with gr.Column(scale=3):
|
103 |
+
gr.HTML(HEADER)
|
104 |
+
gr.Markdown("# ⚡ **Quickstart Examples**")
|
105 |
with gr.Row():
|
106 |
with gr.Column(scale=1):
|
107 |
+
preset_buttons = [gr.Button(example["description"]) for example in EXAMPLES[:len(EXAMPLES)//3]]
|
108 |
+
with gr.Column(scale=1):
|
109 |
+
preset_buttons += [gr.Button(example["description"]) for example in EXAMPLES[len(EXAMPLES)//3:2*len(EXAMPLES)//3]]
|
110 |
with gr.Column(scale=1):
|
111 |
+
preset_buttons += [gr.Button(example["description"]) for example in EXAMPLES[2*len(EXAMPLES)//3:]]
|
112 |
|
113 |
with gr.Row(equal_height=False):
|
114 |
with gr.Column(scale=1):
|
115 |
+
gr.Markdown("## **Evaluation task inputs**")
|
116 |
+
gr.Markdown("*<span style='color: gray;'>Define the input names and values for the evaluation task. Inputs are optional if evaluation depends on the output only.</span>*")
|
117 |
with gr.Group():
|
118 |
inputs_task = gr.State([])
|
119 |
new_input_name = gr.Textbox(label="Name")
|
|
|
146 |
)
|
147 |
|
148 |
with gr.Column(scale=1):
|
149 |
+
gr.Markdown("## **Evaluation task output**")
|
150 |
+
gr.Markdown("*<span style='color: gray;'>Define the output name and value for the evaluation task. Output is always required.</span>*")
|
151 |
with gr.Group():
|
152 |
with gr.Row(equal_height=True):
|
153 |
with gr.Column(min_width=60, scale=2):
|
|
|
155 |
with gr.Column(scale=9):
|
156 |
output_value = gr.Textbox(label="Value", show_label=True, interactive=True, autoscroll=False, max_lines=3)
|
157 |
|
158 |
+
|
|
|
159 |
with gr.Column(scale=1):
|
160 |
+
gr.Markdown("## **Evaluation criteria and rubric**")
|
161 |
+
gr.Markdown("*<span style='color: gray;'>Define the evaluation criteria and rubric for the evaluation task. Supported scoring scales: Binary (0 and 1), 3-Likert and 5-Likert.</span>*\n\n*<span style='color: gray;'>❗You can experiment with other scoring scales. However, performance may vary.</span>*")
|
162 |
+
|
163 |
with gr.Row():
|
164 |
with gr.Column(scale=1):
|
165 |
rubric_items = gr.State([])
|
|
|
196 |
|
197 |
with gr.Row():
|
198 |
with gr.Column(scale=1, variant="panel"):
|
199 |
+
gr.Markdown("# **Evaluation**")
|
200 |
with gr.Group():
|
201 |
with gr.Row(equal_height=True):
|
202 |
with gr.Column(min_width=15, scale=1):
|
examples.py
CHANGED
@@ -66,6 +66,19 @@ EXAMPLES = [
|
|
66 |
{"name": "4", "value": "The model frequently comprehends and accurately applies industry-specific language or technical terms, with only minor mistakes or inconsistencies."},
|
67 |
{"name": "5", "value": "The model perfectly comprehends and applies industry-specific language or technical terms, offering precise, perceptive feedback that demonstrates a comprehensive understanding of the topic."},
|
68 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
]
|
71 |
|
|
|
66 |
{"name": "4", "value": "The model frequently comprehends and accurately applies industry-specific language or technical terms, with only minor mistakes or inconsistencies."},
|
67 |
{"name": "5", "value": "The model perfectly comprehends and applies industry-specific language or technical terms, offering precise, perceptive feedback that demonstrates a comprehensive understanding of the topic."},
|
68 |
]
|
69 |
+
},
|
70 |
+
{
|
71 |
+
"description": "🫠 Response-level Hallucination",
|
72 |
+
"inputs_task": [
|
73 |
+
{"name": "Question", "value": "Which genus of moth in the world's seventh-largest country contains only one species?"},
|
74 |
+
{"name": "Passage", "value": "Indogrammodes is a genus of moths of the Crambidae family. It contains only one species, Indogrammodes pectinicornalis, which is found in India.India, officially the Republic of India (\"Bhārat Gaṇarājya\"), is a country in South Asia. It is the seventh-largest country by area, the second-most populous country (with over 1.2 billion people), and the most populous democracy in the world."},
|
75 |
+
],
|
76 |
+
"output": {"name": "Answer", "value": "The Indogrammodes genus of moths found in India has only one species."},
|
77 |
+
"evaluation_criteria": "Evaluate whether the information provided in the answer is factually accurate and directly supported by the context given in the document, without any fabricated or hallucinated details.",
|
78 |
+
"rubric": [
|
79 |
+
{"name": "0", "value": "The answer is not supported by the document. It contains inaccuracies, fabrications, or details that are not present in the document."},
|
80 |
+
{"name": "1", "value": "The answer is fully supported by the document. It is factually accurate and all details are directly derived from the document."},
|
81 |
+
]
|
82 |
}
|
83 |
]
|
84 |
|
img/flow_judge_banner.png
ADDED