File size: 865 Bytes
e54c29d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""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()