Skip to content

Commit

Permalink
Merge pull request #4065 from janhq/fix/correct-download-script-on-wi…
Browse files Browse the repository at this point in the history
…ndows

fix: correct download script to relocate dll files properly
  • Loading branch information
louis-jan authored Nov 21, 2024
2 parents 18d3ac8 + daefa99 commit e2a4509
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extensions/inference-cortex-extension/download.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set ENGINE_VERSION=0.1.39
set VERSION=v0.1.39
set DOWNLOAD_URL=https://github.com/janhq/cortex.llamacpp/releases/download/%VERSION%/cortex.llamacpp-0.1.39-windows-amd64
set CUDA_DOWNLOAD_URL=https://github.com/janhq/cortex.llamacpp/releases/download/%VERSION%
set SUBFOLDERS=noavx-cuda-12-0 noavx-cuda-11-7 avx2-cuda-12-0 avx2-cuda-11-7 noavx avx avx2 avx512 vulkan
set SUBFOLDERS=windows-amd64-noavx-cuda-12-0 windows-amd64-noavx-cuda-11-7 windows-amd64-avx2-cuda-12-0 windows-amd64-avx2-cuda-11-7 windows-amd64-noavx windows-amd64-avx windows-amd64-avx2 windows-amd64-avx512 windows-amd64-vulkan

call .\node_modules\.bin\download -e --strip 1 -o %BIN_PATH% https://github.com/janhq/cortex.cpp/releases/download/v%CORTEX_VERSION%/cortex-%CORTEX_VERSION%-windows-amd64.tar.gz
call .\node_modules\.bin\download %DOWNLOAD_URL%-avx2-cuda-12-0.tar.gz -e --strip 1 -o %SHARED_PATH%/engines/cortex.llamacpp/windows-amd64-avx2-cuda-12-0/v%ENGINE_VERSION%
Expand All @@ -29,12 +29,12 @@ del %BIN_PATH%\cortex.exe

@REM Loop through each folder and move DLLs (excluding engine.dll)
for %%F in (%SUBFOLDERS%) do (
echo Processing folder: %SHARED_PATH%\engines\cortex.llamacpp\%%F
echo Processing folder: %SHARED_PATH%\engines\cortex.llamacpp\%%F\v%ENGINE_VERSION%

@REM Move all .dll files except engine.dll
for %%D in (%SHARED_PATH%\engines\cortex.llamacpp\%%F\*.dll) do (
for %%D in (%SHARED_PATH%\engines\cortex.llamacpp\%%F\v%ENGINE_VERSION%\*.dll) do (
if /I not "%%~nxD"=="engine.dll" (
move "%%D" "%SHARED_PATH%"
move "%%D" "%BIN_PATH%"
)
)
)
Expand Down
1 change: 1 addition & 0 deletions extensions/inference-cortex-extension/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if [ "$OS_TYPE" == "Linux" ]; then
download "${CUDA_DOWNLOAD_URL}/cuda-12-0-linux-amd64.tar.gz" -e --strip 1 -o "${SHARED_PATH}" 1
download "${CUDA_DOWNLOAD_URL}/cuda-11-7-linux-amd64.tar.gz" -e --strip 1 -o "${SHARED_PATH}" 1
mkdir -p "${SHARED_PATH}/engines/cortex.llamacpp/deps"
touch "${SHARED_PATH}/engines/cortex.llamacpp/deps/keep"

elif [ "$OS_TYPE" == "Darwin" ]; then
# macOS downloads
Expand Down

0 comments on commit e2a4509

Please sign in to comment.