import os import requests base_url = "https://huggingface.co/datasets/aoxo/asr_malayalam/resolve/main/processed_dataset/batch_{}/{}" local_directory = "processed_dataset" os.makedirs(local_directory, exist_ok=True) for batch_num in range(0, 47): batch_dir = os.path.join(local_directory, f"batch_{batch_num}") os.makedirs(batch_dir, exist_ok=True) file_names = [ "data-00000-of-00001.arrow", "data-00000-of-00002.arrow", "data-00001-of-00002.arrow", "dataset_info.json", "state.json" ] for file_name in file_names: file_url = base_url.format(batch_num, file_name) file_path = os.path.join(batch_dir, file_name) response = requests.get(file_url) with open(file_path, "wb") as file: file.write(response.content) print(f"Downloaded: {file_path}")