File size: 3,232 Bytes
3573a39
9e4233f
be473e6
9e4233f
 
3573a39
 
be473e6
 
 
8f809e2
3573a39
 
9e4233f
 
 
 
3573a39
9e4233f
3573a39
9e4233f
3573a39
4a85196
1c00552
 
 
 
4a85196
 
 
 
 
 
1c00552
 
 
 
 
58c39e0
5704515
35be7f4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5704515
35be7f4
5704515
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
INTRODUCTION_MD = """
                <h1 style="text-align: center;">
                🐢Giskard Evaluator
                </h1>
                Welcome to Giskard Evaluator Space! Get your report immediately by simply input your model id and dataset id below. Follow our leads and improve your model in no time.
                """
CONFIRM_MAPPING_DETAILS_MD = """
                            <h1 style="text-align: center;">
                            Confirm Pre-processing Details
                            </h1>
                            Please confirm the pre-processing details below. Align the column names of your model in the <b>dropdown</b> menu to your dataset's. If you are not sure, please double check your model and dataset.
                            """
CONFIRM_MAPPING_DETAILS_FAIL_MD = """
                            <h1 style="text-align: center;">
                            Confirm Pre-processing Details
                            </h1>
                            Sorry, we cannot align the input/output of your dataset with the model. <b>Pleaser double check your model and dataset.</b>
                            """

CONFIRM_MAPPING_DETAILS_FAIL_RAW = """
                            Sorry, we cannot align the input/output of your dataset with the model. Pleaser double check your model and dataset.
                            """

CHECK_CONFIG_OR_SPLIT_RAW = """
                            Please check your dataset config or split.
                            """

PREDICTION_SAMPLE_MD = """
                        <h1 style="text-align: center;">
                        Model Prediction Sample
                        </h1>
                        Here is a sample prediction from your model based on your dataset.
                        """

MAPPING_STYLED_ERROR_WARNING = """
                        <h3 style="text-align: center;color: coral; background-color: #fff0f3; border-radius: 8px; padding: 10px; ">
                        Sorry, we cannot auto-align the labels/features of your dataset and model. Please double check.
                        </h3>
                        """

USE_INFERENCE_API_TIP = """
                We recommend to use
                <a href="https://huggingface.co/docs/api-inference/detailed_parameters#text-classification-task">
                    Hugging Face Inference API
                </a>
                for the evaluation,
                which requires your <a href="https://huggingface.co/settings/tokens">HF token</a>.
                <br/>
                Otherwise, an
                <a href="https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.TextClassificationPipeline">
                    HF pipeline 
                </a>
                will be created and run in this Space. It takes more time to get the result.
                <br/>
                <b>
                Do not worry, your HF token is only used in this Space for your evaluation.
                </b>
            """

def get_styled_input(input):
    return f"""<h3 style="text-align: center;color: #4ca154; background-color: #e2fbe8; border-radius: 8px; padding: 10px; ">
            Sample input: {input}
            </h3>"""