MegaScale / src /03.2_check_uploaded_data.py
maom's picture
update upload assemble and upload scripts
f356ef8
import datasets
import pyarrow
def test_local_hf_match(
dataset_tag,
split):
print(f"For dataset '{dataset_tag}' and split '{split}' testing if local and remote ids match ...")
ids_hf = datasets.load_dataset(
path = "maom/MegaScale",
name = dataset_tag,
data_dir = dataset_tag,
cache_dir = "/scratch/maom_root/maom0/maom",
keep_in_memory = True).data[split].select(['id']).to_pandas()
ids_local = pyarrow.parquet.read_table(
source = f"intermediate/{dataset_tag}_{split}.parquet",
columns = ["id"]).to_pandas()
assert ids_local.equals(ids_hf)
test_local_hf_match("dataset1", "train")
test_local_hf_match("dataset2", "train")
test_local_hf_match("dataset3", "train")
test_local_hf_match("dataset3_single", "train")
test_local_hf_match("dataset3_single", "val")
test_local_hf_match("dataset3_single", "test")
test_local_hf_match("dataset3_single_cv", "train_0")
test_local_hf_match("dataset3_single_cv", "train_1")
test_local_hf_match("dataset3_single_cv", "train_2")
test_local_hf_match("dataset3_single_cv", "train_3")
test_local_hf_match("dataset3_single_cv", "train_4")
test_local_hf_match("dataset3_single_cv", "val_0")
test_local_hf_match("dataset3_single_cv", "val_1")
test_local_hf_match("dataset3_single_cv", "val_2")
test_local_hf_match("dataset3_single_cv", "val_3")
test_local_hf_match("dataset3_single_cv", "val_4")
test_local_hf_match("dataset3_single_cv", "test_0")
test_local_hf_match("dataset3_single_cv", "test_1")
test_local_hf_match("dataset3_single_cv", "test_2")
test_local_hf_match("dataset3_single_cv", "test_3")
test_local_hf_match("dataset3_single_cv", "test_4")