Duplicate from mgoin/mlperf-inference-llama3.1-8b-data
Browse filesCo-authored-by: Michael Goin <mgoin@users.noreply.huggingface.co>
- .gitattributes +59 -0
- README.md +155 -0
- data/train-00000-of-00001.parquet +3 -0
- dataset_dict.json +1 -0
- train-00000-of-00001.parquet +3 -0
- train/data-00000-of-00001.arrow +3 -0
- train/dataset_info.json +24 -0
- train/state.json +13 -0
.gitattributes
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.mds filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
# Audio files - uncompressed
|
| 39 |
+
*.pcm filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
*.sam filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
*.raw filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
# Audio files - compressed
|
| 43 |
+
*.aac filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
*.ogg filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
# Image files - uncompressed
|
| 49 |
+
*.bmp filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
*.tiff filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
# Image files - compressed
|
| 54 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
# Video files - compressed
|
| 58 |
+
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
+
*.webm filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
dataset_info:
|
| 3 |
+
features:
|
| 4 |
+
- name: dataset
|
| 5 |
+
dtype: string
|
| 6 |
+
- name: system_prompt
|
| 7 |
+
dtype: string
|
| 8 |
+
- name: question
|
| 9 |
+
dtype: string
|
| 10 |
+
- name: output
|
| 11 |
+
dtype: string
|
| 12 |
+
splits:
|
| 13 |
+
- name: train
|
| 14 |
+
num_bytes: 34308821
|
| 15 |
+
num_examples: 13368
|
| 16 |
+
download_size: 34308821
|
| 17 |
+
dataset_size: 34308821
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# CNN Evaluation Dataset
|
| 21 |
+
|
| 22 |
+
This dataset contains 13368 examples from the CNN evaluation dataset, converted to the MLPerf Inference format.
|
| 23 |
+
|
| 24 |
+
## Dataset Structure
|
| 25 |
+
|
| 26 |
+
- **dataset**: Source dataset name ("cnn_eval")
|
| 27 |
+
- **system_prompt**: Empty string (as requested)
|
| 28 |
+
- **question**: Combined instruction and input text
|
| 29 |
+
- **output**: Expected output/summary
|
| 30 |
+
|
| 31 |
+
## Usage
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
from datasets import load_dataset
|
| 35 |
+
|
| 36 |
+
# Load the dataset
|
| 37 |
+
dataset = load_dataset("path/to/this/dataset")
|
| 38 |
+
print(dataset)
|
| 39 |
+
|
| 40 |
+
# Access the training data
|
| 41 |
+
train_data = dataset["train"]
|
| 42 |
+
print(f"Number of examples: {len(train_data)}")
|
| 43 |
+
|
| 44 |
+
# Example usage
|
| 45 |
+
example = train_data[0]
|
| 46 |
+
print(f"Question: {example['question'][:100]}...")
|
| 47 |
+
print(f"Output: {example['output']}")
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
## Source
|
| 51 |
+
|
| 52 |
+
Converted from cnn_eval.json using the following conversion script.
|
| 53 |
+
Generated dataset matches the structure of [mgoin/mlperf-inference-llama3.1-405b-data](https://huggingface.co/datasets/mgoin/mlperf-inference-llama3.1-405b-data).
|
| 54 |
+
|
| 55 |
+
```python
|
| 56 |
+
#!/usr/bin/env python3
|
| 57 |
+
|
| 58 |
+
import json
|
| 59 |
+
import os
|
| 60 |
+
from datasets import Dataset, DatasetDict
|
| 61 |
+
from tqdm import tqdm
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def convert_cnn_to_parquet(input_file, output_dir="cnn_dataset_parquet"):
|
| 65 |
+
"""
|
| 66 |
+
Convert cnn_eval.json to HuggingFace dataset format in parquet format.
|
| 67 |
+
This creates the exact same structure as the reference dataset:
|
| 68 |
+
mgoin/mlperf-inference-llama3.1-data
|
| 69 |
+
|
| 70 |
+
Args:
|
| 71 |
+
input_file: Path to cnn_eval.json
|
| 72 |
+
output_dir: Directory to save the HuggingFace dataset in parquet format
|
| 73 |
+
"""
|
| 74 |
+
|
| 75 |
+
# Load the JSON data
|
| 76 |
+
print(f"Loading data from {input_file}...")
|
| 77 |
+
with open(input_file, "r") as f:
|
| 78 |
+
data = json.load(f)
|
| 79 |
+
|
| 80 |
+
print(f"Found {len(data)} items")
|
| 81 |
+
|
| 82 |
+
# Convert to HuggingFace format
|
| 83 |
+
converted_data = []
|
| 84 |
+
|
| 85 |
+
for item in tqdm(data, desc="Converting items"):
|
| 86 |
+
# Get the instruction template
|
| 87 |
+
instruction_template = item["instruction"]["llama"]
|
| 88 |
+
|
| 89 |
+
# Substitute {input} with the actual input text
|
| 90 |
+
question = instruction_template.format(input=item["input"])
|
| 91 |
+
|
| 92 |
+
# Create the HuggingFace dataset format
|
| 93 |
+
hf_item = {
|
| 94 |
+
"dataset": "cnn_eval", # Source dataset name
|
| 95 |
+
"system_prompt": "", # Empty as requested
|
| 96 |
+
"question": question, # Combined instruction + input
|
| 97 |
+
"output": item["output"], # Expected output
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
converted_data.append(hf_item)
|
| 101 |
+
|
| 102 |
+
# Create HuggingFace dataset
|
| 103 |
+
dataset = Dataset.from_list(converted_data)
|
| 104 |
+
|
| 105 |
+
# Create DatasetDict with train split
|
| 106 |
+
dataset_dict = DatasetDict({"train": dataset})
|
| 107 |
+
|
| 108 |
+
# Create the data directory structure like the reference dataset
|
| 109 |
+
data_dir = os.path.join(output_dir, "data")
|
| 110 |
+
os.makedirs(data_dir, exist_ok=True)
|
| 111 |
+
|
| 112 |
+
# Save as parquet in the data directory
|
| 113 |
+
parquet_file = os.path.join(data_dir, "train-00000-of-00001.parquet")
|
| 114 |
+
print(f"Saving dataset to {parquet_file}...")
|
| 115 |
+
dataset_dict["train"].to_parquet(parquet_file)
|
| 116 |
+
|
| 117 |
+
# Create README.md similar to the reference dataset
|
| 118 |
+
readme_content = """"""
|
| 119 |
+
|
| 120 |
+
readme_file = os.path.join(output_dir, "README.md")
|
| 121 |
+
with open(readme_file, "w") as f:
|
| 122 |
+
f.write(readme_content)
|
| 123 |
+
|
| 124 |
+
print(f"Conversion complete!")
|
| 125 |
+
print(f"Parquet file saved to: {parquet_file}")
|
| 126 |
+
print(f"README.md saved to: {readme_file}")
|
| 127 |
+
print(f"Total items: {len(converted_data)}")
|
| 128 |
+
print(f"File size: {os.path.getsize(parquet_file) / 1024 / 1024:.2f} MB")
|
| 129 |
+
|
| 130 |
+
# Print a sample for verification
|
| 131 |
+
print("\nSample converted item:")
|
| 132 |
+
sample = converted_data[0]
|
| 133 |
+
print(f"Dataset: {sample['dataset']}")
|
| 134 |
+
print(f"System prompt: '{sample['system_prompt']}'")
|
| 135 |
+
print(f"Question (first 200 chars): {sample['question'][:200]}...")
|
| 136 |
+
print(f"Output (first 100 chars): {sample['output'][:100]}...")
|
| 137 |
+
|
| 138 |
+
# Print dataset info
|
| 139 |
+
print(f"\nDataset info:")
|
| 140 |
+
print(f"Features: {dataset_dict['train'].features}")
|
| 141 |
+
print(f"Number of rows: {len(dataset_dict['train'])}")
|
| 142 |
+
|
| 143 |
+
return dataset_dict
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
if __name__ == "__main__":
|
| 147 |
+
# Check if cnn_eval.json exists
|
| 148 |
+
input_file = "cnn_eval.json"
|
| 149 |
+
if not os.path.exists(input_file):
|
| 150 |
+
print(f"Error: {input_file} not found in current directory")
|
| 151 |
+
exit(1)
|
| 152 |
+
|
| 153 |
+
convert_cnn_to_parquet(input_file)
|
| 154 |
+
|
| 155 |
+
```
|
data/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3486aa6fb6ddac38f5fcdd19274833975432dff743fe4aa946dc6a914d07092a
|
| 3 |
+
size 34308821
|
dataset_dict.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"splits": ["train"]}
|
train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3486aa6fb6ddac38f5fcdd19274833975432dff743fe4aa946dc6a914d07092a
|
| 3 |
+
size 34308821
|
train/data-00000-of-00001.arrow
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:877981b36913311d85546db86c45eb1cde21438b4425b546f833f68db42d7b21
|
| 3 |
+
size 59075968
|
train/dataset_info.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"citation": "",
|
| 3 |
+
"description": "",
|
| 4 |
+
"features": {
|
| 5 |
+
"dataset": {
|
| 6 |
+
"dtype": "string",
|
| 7 |
+
"_type": "Value"
|
| 8 |
+
},
|
| 9 |
+
"system_prompt": {
|
| 10 |
+
"dtype": "string",
|
| 11 |
+
"_type": "Value"
|
| 12 |
+
},
|
| 13 |
+
"question": {
|
| 14 |
+
"dtype": "string",
|
| 15 |
+
"_type": "Value"
|
| 16 |
+
},
|
| 17 |
+
"output": {
|
| 18 |
+
"dtype": "string",
|
| 19 |
+
"_type": "Value"
|
| 20 |
+
}
|
| 21 |
+
},
|
| 22 |
+
"homepage": "",
|
| 23 |
+
"license": ""
|
| 24 |
+
}
|
train/state.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_data_files": [
|
| 3 |
+
{
|
| 4 |
+
"filename": "data-00000-of-00001.arrow"
|
| 5 |
+
}
|
| 6 |
+
],
|
| 7 |
+
"_fingerprint": "1b412bf751b47c46",
|
| 8 |
+
"_format_columns": null,
|
| 9 |
+
"_format_kwargs": {},
|
| 10 |
+
"_format_type": null,
|
| 11 |
+
"_output_all_columns": false,
|
| 12 |
+
"_split": null
|
| 13 |
+
}
|