File size: 839 Bytes
a1d4687
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import os
from huggingface_hub import HfApi, create_repo

LOCAL_DATA_PATH = "."
REPO_ID = "prokajevo/splice-benchmark" 

def upload_splice_robustly():
    print(f"Starting robust upload for repository: {REPO_ID}")
    
    api = HfApi()

    print(f"Ensuring repository '{REPO_ID}' exists...")
    create_repo(
        repo_id=REPO_ID,
        repo_type="dataset",
        exist_ok=True,
    )
    print("Repository exists.")

    print(f"Starting parallel upload of folder '{os.path.abspath(LOCAL_DATA_PATH)}'...")
    api.upload_large_folder(
        folder_path=LOCAL_DATA_PATH,
        repo_id=REPO_ID,
        repo_type="dataset"
                )

    print("\n--- Parallel Upload Complete! ---")
    print(f"Visit your dataset at: https://huggingface.co/datasets/{REPO_ID}")


if __name__ == "__main__":
    upload_splice_robustly()