File size: 683 Bytes
a14a1b8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import os
import yaml
data_folder = "data"
data = {"license": "mit", "configs": []}
# Collect configurations based on folder structure
for folder_name in os.listdir(data_folder):
folder_path = os.path.join(data_folder, folder_name)
if os.path.isdir(folder_path):
config = {
"config_name": folder_name,
"data_files": f"{folder_path}/{folder_name}_dataset.parquet"
}
data["configs"].append(config)
# Write YAML to README.md with delimiters
with open("README.md", "w") as file:
file.write("---\n") # Add starting delimiter
yaml.dump(data, file, default_flow_style=False)
file.write("---\n") # Add ending delimiter |