DECRO / push.py
korallll's picture
Add files using upload-large-folder tool
e54c29d verified
Raw
History Blame Contribute Delete
865 Bytes
"""Push the built DECRO dataset to the HF Hub (resumable, proxy-free).
Run with the network proxy unset for the >1 GB shard upload:
env -u HTTP_PROXY -u HTTPS_PROXY -u http_proxy -u https_proxy python push.py
"""
from pathlib import Path
from huggingface_hub import HfApi
REPO_ID = "SpeechAntiSpoofingBenchmarks/DECRO"
FOLDER = Path(__file__).resolve().parent
IGNORE = [
"_clean_flac/**",
"__pycache__/**",
"*.pyc",
".cache/**",
".git/**",
".gitignore",
]
def main():
api = HfApi()
api.create_repo(REPO_ID, repo_type="dataset", exist_ok=True)
api.upload_large_folder(
repo_id=REPO_ID,
repo_type="dataset",
folder_path=str(FOLDER),
ignore_patterns=IGNORE,
)
info = api.dataset_info(REPO_ID)
print("Pushed. Latest commit SHA:", info.sha)
if __name__ == "__main__":
main()