|
|
|
|
|
""" |
|
|
Script to load and verify the matrix_operations dataset |
|
|
""" |
|
|
|
|
|
import json |
|
|
from pathlib import Path |
|
|
|
|
|
def load_and_verify_dataset(): |
|
|
dataset_path = Path(".") |
|
|
|
|
|
print(f"Loading {config.name} dataset...") |
|
|
|
|
|
|
|
|
train_data = [] |
|
|
if (dataset_path / "train.jsonl").exists(): |
|
|
with open(dataset_path / "train.jsonl", "r") as f: |
|
|
for line in f: |
|
|
train_data.append(json.loads(line)) |
|
|
print(f"Loaded {len(train_data)} train samples") |
|
|
|
|
|
|
|
|
test_data = [] |
|
|
if (dataset_path / "test.jsonl").exists(): |
|
|
with open(dataset_path / "test.jsonl", "r") as f: |
|
|
for line in f: |
|
|
test_data.append(json.loads(line)) |
|
|
print(f"Loaded {len(test_data)} test samples") |
|
|
|
|
|
|
|
|
print("\nDataset Validation:") |
|
|
print(f"Total samples: {len(train_data) + len(test_data)}") |
|
|
|
|
|
if train_data: |
|
|
sample = train_data[0] |
|
|
print(f"Sample keys: {list(sample.keys())}") |
|
|
print(f"Matrix size: {sample.get('matrix_size')}") |
|
|
print(f"Operations count: {len(sample.get('operations', []))}") |
|
|
|
|
|
print("\nDataset ready for use!") |
|
|
print("To upload to Hugging Face Hub:") |
|
|
print(f" git push https://huggingface.co/datasets/your-username/{config.name}") |
|
|
|
|
|
if __name__ == "__main__": |
|
|
load_and_verify_dataset() |
|
|
|