@echo off

set "zipUrl=https://huggingface.co/MonsterMMORPG/SECourses/resolve/main/cudnn-windows-x86_64-8.9.2.26_cuda11.zip"
set "zipFile=cudnn-windows-x86_64-8.9.2.26_cuda11.zip"
set "extractFolder=.\venv\Lib\site-packages\torch\lib"

echo Downloading zip file...
powershell -command "(New-Object System.Net.WebClient).DownloadFile('%zipUrl%', '%zipFile%')"

if %errorlevel% neq 0 (
    echo Failed to download the zip file.
    exit /b
)

echo Zip file downloaded successfully.

echo Extracting zip file...
powershell -command "Expand-Archive -Force -Path '.\%zipFile%' -DestinationPath '%extractFolder%'"

if %errorlevel% neq 0 (
    echo Failed to extract the zip file.
    exit /b
)

echo Zip file extracted successfully.

echo Completed: Downloaded and extracted the zip file.
pause
