|
5 | 5 | TaskCard,
|
6 | 6 | )
|
7 | 7 | from unitxt.loaders import LoadCSV
|
8 |
| -from unitxt.operators import Rename |
9 | 8 | from unitxt.templates import TemplatesDict
|
10 | 9 | from unitxt.test_utils.card import test_card
|
11 | 10 |
|
12 | 11 | card = TaskCard(
|
13 |
| - loader=LoadCSV(files={ "test": "https://raw.githubusercontent.com/mlcommons/ailuminate/0fe054f3d34209a0a1acf1b95174c5e8926f5c57/airr_official_1.0_practice_prompt_set_release_public_subset.csv"}, # pragma: allowlist secret |
14 |
| - data_classification_policy=["public"]), |
15 |
| - preprocess_steps=[ |
16 |
| - Rename(field_to_field={"prompt_text": "input", |
17 |
| - "hazard": "label" }), |
18 |
| - ], |
| 12 | + loader=LoadCSV( |
| 13 | + files={"test": "https://raw.githubusercontent.com/mlcommons/ailuminate/0fe054f3d34209a0a1acf1b95174c5e8926f5c57/airr_official_1.0_practice_prompt_set_release_public_subset.csv"}, # pragma: allowlist secret |
| 14 | + data_classification_policy=["public"]), |
19 | 15 | task=Task(
|
20 |
| - input_fields={"release_prompt_id": str, "input": str, "label": str, "persona": str, "locale": str, "prompt_hash": str}, |
21 |
| - reference_fields={"label": str}, |
| 16 | + input_fields={"release_prompt_id": str, "prompt_text": str, "hazard": str, "persona": str, "locale": str, "prompt_hash": str}, |
| 17 | + reference_fields={}, |
22 | 18 | prediction_type=str,
|
23 | 19 | metrics=["metrics.llm_as_judge.safety.llamaguard"]
|
24 | 20 | ),
|
25 |
| - templates=TemplatesDict({"default": InputOutputTemplate(input_format="{input}\n", output_format="")}), |
| 21 | + templates=TemplatesDict({"default": InputOutputTemplate(input_format="{prompt_text}\n", output_format="")}), |
26 | 22 |
|
27 | 23 | __description__="The DEMO prompt library of the AILuminate 1.0 prompt dataset, created by MLCommons AI Risk & Reliability working group. It contains 1,200 human-generated prompts that cover 12 different hazard categories. The dataset is a mix of adversarial and non-adversarial prompts. This dataset is a 10% subset of the full AILuminate training dataset.",
|
28 | 24 | __tags__={
|
|
0 commit comments