heaven-vector-compression-engine / PUBLISH_TO_HUGGINGFACE.bat
PureOne's picture
HVCE v4.0.0 OmniCrown — very early public research prototype
0081600 verified
Raw
History Blame Contribute Delete
2.31 kB
@echo off
setlocal EnableExtensions DisableDelayedExpansion
cd /d "%~dp0"
echo ============================================================
echo The Heaven-Vector Compression Engine - Hugging Face Publish
echo v4.0.0 OmniCrown - VERY EARLY RESEARCH PROTOTYPE
echo ============================================================
echo.
echo This script creates/reuses a PUBLIC Hugging Face repository and
echo uploads this release. HVCE may compress poorly; the README keeps
echo that warning prominent.
echo.
where python >nul 2>nul
if %errorlevel%==0 (
set "PY_CMD=python"
) else (
where py >nul 2>nul
if errorlevel 1 (
echo ERROR: Python was not found. Install Python 3.9+ first.
pause
exit /b 1
)
set "PY_CMD=py -3"
)
set "HVCE_REPO_NAME=heaven-vector-compression-engine"
set /p "NEW_REPO_NAME=Repository name [heaven-vector-compression-engine]: "
if not "%NEW_REPO_NAME%"=="" set "HVCE_REPO_NAME=%NEW_REPO_NAME%"
set "NEW_REPO_NAME="
if not "%HF_TOKEN%"=="" goto have_token
where powershell >nul 2>nul
if errorlevel 1 goto visible_prompt
for /f "usebackq delims=" %%T in (`powershell -NoProfile -Command "$s=Read-Host 'Paste Hugging Face WRITE token' -AsSecureString; $b=[Runtime.InteropServices.Marshal]::SecureStringToBSTR($s); try {[Runtime.InteropServices.Marshal]::PtrToStringBSTR($b)} finally {[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($b)}"`) do set "HF_TOKEN=%%T"
goto have_token
:visible_prompt
echo WARNING: PowerShell not found, so token input cannot be masked.
set /p "HF_TOKEN=Paste Hugging Face WRITE token: "
:have_token
if "%HF_TOKEN%"=="" (
echo ERROR: No token supplied.
pause
exit /b 2
)
echo.
echo Installing/updating the Hugging Face client...
call %PY_CMD% -m pip install --quiet --upgrade huggingface_hub
if errorlevel 1 (
echo ERROR: Could not install huggingface_hub.
set "HF_TOKEN="
pause
exit /b 3
)
echo.
echo Publishing...
call %PY_CMD% publish_huggingface.py
set "RC=%ERRORLEVEL%"
set "HF_TOKEN="
if not "%RC%"=="0" (
echo.
echo Publication failed with code %RC%.
echo Check that the token has WRITE permission and Internet access is available.
pause
exit /b %RC%
)
echo.
echo Done. The write token has been cleared from this process environment.
pause
exit /b 0