File size: 597 Bytes
ec368dd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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()
|