gibridllm-code / scripts /push_code.py
unkony's picture
sync code
c105f80 verified
Raw History Blame Contribute Delete
772 Bytes
r"""Выкладывает код проекта (src, scripts, README) в приватный репозиторий HF, откуда его забирает Kaggle.
Запуск с ПК: G:\Projects\ElyonLLM\.venv\Scripts\python.exe scripts\push_code.py
"""
from pathlib import Path
from huggingface_hub import HfApi
ROOT = Path(__file__).resolve().parents[1]
REPO = "unkony/gibridllm-code"
api = HfApi()
api.create_repo(REPO, private=True, exist_ok=True)
info = api.upload_folder(
folder_path=str(ROOT), repo_id=REPO,
allow_patterns=["src/**", "scripts/**", "README.md"],
ignore_patterns=["**/__pycache__/**", "*.pyc"],
commit_message="sync code",
)
print("готово:", info.commit_url)
print(sorted(api.list_repo_files(REPO)))