File size: 891 Bytes
3b39b49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d15e788
 
 
 
 
 
 
 
02b7dec
 
d15e788
97fcd0c
 
 
 
 
eaa5563
 
97fcd0c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import gradio as gr


def get_qid_selector(dataset_size: int):
    return gr.Number(
        info="Question ID",
        value=1,
        precision=0,
        minimum=1,
        maximum=dataset_size,
        show_label=False,
        scale=0,
        container=False,
        elem_classes="qid-selector",
    )


def get_pipeline_selector(model_options: list[str]):
    return gr.Dropdown(
        label="User Submissions and Examples",
        choices=model_options,
        value="",
        interactive=True,
        container=False,
        elem_classes="pipeline-selector",
    )


def get_panel_header(header: str, subheader: str | None = None):
    html = f"<h4 class='panel-header'>{header}</h4>"
    if subheader:
        html += f"<p class='md panel-subheader'>{subheader}</p>"
    with gr.Row(elem_classes="md panel-header-container") as row:
        gr.HTML(html)
    return row