| @echo off |
| setlocal enabledelayedexpansion |
| set "ROOT=%~dp0.." |
| pushd "%ROOT%" |
| set "ROOT=%cd%" |
|
|
| title HUGGING FACE - PRIVATE SYNC |
| color 0B |
|
|
| echo. |
| echo ####################################################### |
| echo # # |
| echo # HUGGING FACE PRIVATE SYNC (GIT LFS) # |
| echo # # |
| echo ####################################################### |
| echo. |
|
|
| :: Check for Git |
| git --version >nul 2>&1 |
| if %errorlevel% neq 0 ( |
| echo [ERROR] Git is not installed or not in PATH. |
| pause |
| exit /b |
| ) |
|
|
| :: User Input for Repo URL |
| if not exist ".hf_repo_url" ( |
| echo [FIRST TIME SETUP] |
| set /p repo_url="Enter your Private HF Dataset URL (e.g., https://huggingface.co/datasets/username/repo): " |
| echo !repo_url! > ".hf_repo_url" |
| ) |
| set /p repo_url=<".hf_repo_url" |
|
|
| echo [1/4] Initializing Git LFS... |
| git init >nul 2>&1 |
| git lfs install >nul 2>&1 |
|
|
| :: Track large binaries automatically |
| echo [2/4] Tracking Large Binaries (*.exe, *.dll, *.zip, *.7z)... |
| git lfs track "*.exe" |
| git lfs track "*.dll" |
| git lfs track "*.zip" |
| git lfs track "*.7z" |
| git lfs track "*.msi" |
| git lfs track "*.iso" |
| git lfs track "*.bin" |
| git lfs track "*.dat" |
| git lfs track ".gitattributes" |
|
|
| echo [3/4] Adding files to commit... |
| git remote add origin !repo_url! >nul 2>&1 |
| git add . |
|
|
| echo [4/4] Pushing to Hugging Face... |
| set /p msg="Enter update message (default: Update tools): " |
| if "!msg!"=="" set "msg=Update tools" |
|
|
| git commit -m "!msg!" |
| git branch -M main |
| git push -u origin main |
|
|
| echo. |
| echo ======================================================= |
| echo SUCCESS: Your project is now synced with Hugging Face! |
| echo Everything is organized and private. |
| echo ======================================================= |
| echo. |
| pause |
|
|