From 85907094807d413ebacf6dfbe5e82ab40c74396a Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 21 Nov 2024 10:53:51 +0700 Subject: [PATCH 1/2] fix: correct download script to relocate dll files properly --- extensions/inference-cortex-extension/download.bat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/inference-cortex-extension/download.bat b/extensions/inference-cortex-extension/download.bat index 25527eb36..1ab14a03c 100644 --- a/extensions/inference-cortex-extension/download.bat +++ b/extensions/inference-cortex-extension/download.bat @@ -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% @@ -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%" ) ) ) From daefa99a9de8e65e80b896cf0c670a31b55a5da8 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 21 Nov 2024 11:17:14 +0700 Subject: [PATCH 2/2] chore: keep the deps folder with gitkeep placeholder file --- extensions/inference-cortex-extension/download.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/inference-cortex-extension/download.sh b/extensions/inference-cortex-extension/download.sh index a8f1ade9e..aa09d6749 100755 --- a/extensions/inference-cortex-extension/download.sh +++ b/extensions/inference-cortex-extension/download.sh @@ -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