Skip to content

Commit 3e11143

Browse files
authored
feat: update gradio image in readme, (#308)
add limit of label in gradio
1 parent 28785c7 commit 3e11143

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

app_gradio/app.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ def update_rule_list(rule_type_mapping, rule_type):
213213
return gr.CheckboxGroup(
214214
choices=rule_type_mapping.get(rule_type, []),
215215
value=[],
216-
label="rule_list"
216+
label="rule_list",
217+
elem_classes="limited-height-checkboxgroup"
217218
)
218219

219220

@@ -388,12 +389,14 @@ def get_data_column_mapping():
388389
)
389390
rule_list = gr.CheckboxGroup(
390391
choices=rule_type_mapping.get(rule_type_options[0], []),
391-
label="Rule List"
392+
label="Rule List",
393+
elem_classes="limited-height-checkboxgroup"
392394
)
393395
# LLM evaluator list
394396
llm_list = gr.CheckboxGroup(
395397
choices=llm_options,
396-
label="LLM List"
398+
label="LLM List",
399+
elem_classes="limited-height-checkboxgroup"
397400
)
398401

399402
gr.Markdown("### EvalPipline Configuration")

app_gradio/header.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
a {
2828
text-decoration: none;
2929
}
30+
/* 限制 Rule List 和 LLM List 的高度 */
31+
.limited-height-checkboxgroup .wrap {
32+
max-height: 160px !important;
33+
overflow-y: auto !important;
34+
}
3035
</style></head>
3136

3237
<body>

docs/assets/gradio_demo.old.png

124 KB
Loading

docs/assets/gradio_demo.png

25.4 KB
Loading

0 commit comments

Comments
 (0)