OmniVoice_sync_data_and_code / upload_to_hf.py
Abdelrahman2922's picture
Add files using upload-large-folder tool
a4d9876 verified
Raw
History Blame Contribute Delete
1.04 kB
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 🚀")