import json | |
import pandas as pd | |
def compute_stats(): | |
stats = {} | |
for split in ["train", "eval", "test"]: | |
total_examples = 0 | |
for i in range(10): | |
try: | |
df = pd.read_parquet(f'data/{split}-0000{i}-of-0000{4 if split == "train" else 2 if split == "eval" else 3}.parquet') | |
total_examples += len(df) | |
except FileNotFoundError: | |
break | |
stats[split] = total_examples | |
with open('release_stats.json', 'w') as f: | |
json.dump(stats, f, indent=4) | |
if __name__ == "__main__": | |
compute_stats() | |