Datasets:

Modalities:
Text
Formats:
webdataset
ArXiv:
Libraries:
Datasets
WebDataset
License:
Xeno-Canto-6s-16khz / download.py
ilyassmoummad's picture
Create download.py
6873df0 verified
raw
history blame contribute delete
804 Bytes
from huggingface_hub import hf_hub_download
import string
import os
REPO_NAME = "ilyassmoummad/Xeno-Canto-6s-16khz"
DESTINATION_PATH = "" # <- The path where you want to download the data
os.makedirs(DESTINATION_PATH, exist_ok=True)
base_file = "xc-6s-16khz-pann.tar."
tar_files = [f"{base_file}{ext}" for ext in (string.ascii_lowercase[i] + string.ascii_lowercase[j] for i in range(0, 1) for j in range(0, 13))]
for tar_file in tar_files:
try:
file_path = hf_hub_download(repo_id=REPO_NAME, filename=tar_file, repo_type="dataset")
dest_file_path = os.path.join(DESTINATION_PATH, os.path.basename(file_path))
os.rename(file_path, dest_file_path)
print(f"Downloaded {dest_file_path}")
except Exception as e:
print(f"Failed to download {tar_file}: {e}")