Datasets:

Modalities:
Text
Formats:
parquet
Languages:
English
Size:
< 1K
ArXiv:
Libraries:
Datasets
pandas
License:
natolambert commited on
Commit
d1ecb0f
1 Parent(s): 9163991

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -0
README.md CHANGED
@@ -1,3 +1,27 @@
1
  ---
2
  license: apache-2.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
  ---
4
+ To create the dataset, we do the following for our internal tooling.
5
+ * rename `turns` to `prompts`,
6
+ * add empty `reference` to remaining prompts (for HF Datasets),
7
+ * Use the following code to load and save as a dataset
8
+ ```python
9
+ from datasets import load_dataset
10
+ import hashlib
11
+
12
+ data = load_dataset("json", data_files="https://huggingface.co/datasets/HuggingFaceH4/mt_bench_prompts/raw/main/raw/question.jsonl", split="train")
13
+
14
+ # %% create_dataset.ipynb 11
15
+ def format_example(example):
16
+ return {
17
+ "prompt": example["prompt"],
18
+ "prompt_id": int(hashlib.sha256(''.join(example["prompt"]).encode("utf-8")).hexdigest(), 16) % (10 ** 8),
19
+ "category": example["category"],
20
+ "reference": example["reference"],
21
+ }
22
+
23
+ formatted_ds = data.map(format_example, num_proc=6, remove_columns=data.column_names)
24
+
25
+ #
26
+ formatted_ds.push_to_hub("HuggingFaceH4/mt_bench_prompts", split="train")
27
+ ```