File size: 772 Bytes
c105f80 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 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)))
|