crash-simulation-demo / prepare.py
sps44's picture
Duplicate from renumics/cifar100-sliceline-demo
f7bfdc4
raw
history blame contribute delete
647 Bytes
import pickle
import datasets
import os
import pandas as pd
if __name__ == "__main__":
cache_file = "dataset_cache.parquet"
if os.path.exists(cache_file):
# Load dataset from cache
df = pd.read_parquet(cache_file)
print("Dataset loaded from cache.")
else:
# Load dataset using datasets.load_dataset()
dataset = datasets.load_dataset("renumics/cifar100-enriched", split="test")
print("Dataset loaded using datasets.load_dataset().")
df = dataset.to_pandas()
# Save dataset to cache
df.to_parquet(cache_file)
print("Dataset saved to cache.")