icrm-hitek-full / setup.bat
PhisherJR's picture
Duplicate from Kzr0xx/icrm-hitek-full-db-mixed
e13caf9
Raw
History Blame Contribute Delete
2.71 kB
@echo off
setlocal enabledelayedexpansion
chcp 65001 >nul
title ICMR+HITEK API - One-Click Setup
echo ============================================================
echo ICMR + HITEK Search API - One-Click Setup (Windows)
echo Total download: ~305 GB. Make sure you have enough space!
echo ============================================================
echo.
set "DATA_REPO=Kzr0xx/Icmr-and-hitek"
set "FULL_REPO=Kzr0xx/icrm-hitek-full-db-mixed"
set "FILES=part1.parquet part2a.parquet part2b_new.parquet"
set "IDX=idx_phone.0.parquet idx_phone.1.parquet idx_phone.2.parquet idx_phone.3.parquet idx_phone.4.parquet idx_phone.5.parquet idx_phone.6.parquet idx_aadhar.0.parquet idx_aadhar.1.parquet idx_aadhar.2.parquet idx_aadhar.3.parquet idx_aadhar.4.parquet idx_aadhar.5.parquet idx_aadhar.6.parquet"
set "CODE=main.py build_index.py run_api.bat requirements.txt"
if not exist "%~dp0data" mkdir "%~dp0data"
cd /d "%~dp0"
echo [1/5] Downloading data files (104 GB)...
for %%f in (%FILES%) do (
if not exist "data\%%f" (
echo Downloading %%f ...
curl -L -C - -o "data\%%f" "https://huggingface.co/datasets/%DATA_REPO%/resolve/main/%%f"
if errorlevel 1 ( echo FAILED: %%f & pause & exit /b 1 )
) else (
echo %%f already exists, skipping
)
)
echo [2/5] Downloading index parts (200 GB)...
for %%f in (%IDX%) do (
if not exist "data\%%f" (
echo Downloading %%f ...
curl -L -C - -o "data\%%f" "https://huggingface.co/datasets/%FULL_REPO%/resolve/main/%%f"
if errorlevel 1 ( echo FAILED: %%f & pause & exit /b 1 )
) else (
echo %%f already exists, skipping
)
)
echo [3/5] Downloading code files...
for %%f in (%CODE%) do (
curl -L -C - -o "%%f" "https://huggingface.co/datasets/%FULL_REPO%/resolve/main/%%f"
)
echo [4/5] Setting up Python environment...
set "PYCMD=python"
where python >nul 2>nul
if errorlevel 1 (
where py >nul 2>nul
if errorlevel 1 (
echo Python not found! Install Python 3.11+ from https://www.python.org/downloads/
pause & exit /b 1
)
set "PYCMD=py -3"
)
if not exist ".venv" %PYCMD% -m venv .venv
".venv\Scripts\python.exe" -m pip install -q --upgrade pip
".venv\Scripts\python.exe" -m pip install -q -r requirements.txt
echo [5/5] Starting API server...
set "ICMR_DATA_DIR=%~dp0data"
start "ICMR+HITEK API" /min ".venv\Scripts\python.exe" -m uvicorn main:app --host 127.0.0.1 --port 8001 --workers 1
echo.
echo ============================================================
echo API is starting on http://127.0.0.1:8001
echo Docs: http://127.0.0.1:8001/docs
echo ============================================================
timeout /t 5 >nul
pause