File size: 1,038 Bytes
a4d9876
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from huggingface_hub import HfApi, create_repo
import os

# =========================
# CONFIG
# =========================
repo_name = "OmniVoice_sync_data_and_code"
username = "TTS-ORG"

local_path = os.path.expanduser("~/OmniVoice")

repo_id = f"{username}/{repo_name}"

# =========================
# INIT
# =========================
api = HfApi()

# =========================
# CREATE REPO
# =========================
create_repo(
    repo_id=repo_id,
    repo_type="model",
    exist_ok=True,
)

print(f"Repo ready: {repo_id}")

# =========================
# UPLOAD LARGE FOLDER
# =========================
api.upload_large_folder(
    folder_path=local_path,
    repo_id=repo_id,
    repo_type="model",

    # VERY IMPORTANT
    ignore_patterns=[
        ".git/*",
        ".venv/*",
        "__pycache__/*",
        "*.pyc",

       

        # huge optimizer states
        "*.bin",

        # cache/temp
        "*.tmp",
        "*.log",

        # optional
        "out.wav",
    ],
)

print("Upload completed successfully 🚀")