# Upload the generated prefixes in generated_prefixes.json to huggingface datasets
#%%
import json
from datasets import Dataset, DatasetDict

if __name__ == "__main__":
    with open('generated_prefixes.json', 'r') as f:
        prefix_data = json.load(f)


    ds_prefixes = DatasetDict({
            split_name: Dataset.from_dict({'prefix':split_data}) 
            for split_name, split_data in prefix_data.items()
        })
    # shuffle the prefixes
    ds_prefixes = ds_prefixes.shuffle(seed=42)
    
    print(ds_prefixes)
    ds_prefixes.push_to_hub("contextmodification/sandbagging-prefixes")
