From 236a038274f88e58c5e746438ccf391a372d9e61 Mon Sep 17 00:00:00 2001 From: jinbridge <2635480475@qq.com> Date: Thu, 2 Nov 2023 01:01:26 +0800 Subject: [PATCH] fix: setup.bat --- .../bigdl-release-portable-executable-zip.yml | 4 ++-- python/llm/portable-zip/setup.bat | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bigdl-release-portable-executable-zip.yml b/.github/workflows/bigdl-release-portable-executable-zip.yml index 4b60f7119c7..508cfcdd130 100644 --- a/.github/workflows/bigdl-release-portable-executable-zip.yml +++ b/.github/workflows/bigdl-release-portable-executable-zip.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: run bat - run: '& ./python/llm/portable-zip/setup.bat' + run: '& cd ./python/llm/portable-zip; ./setup.bat' shell: powershell build-zip-gui: @@ -29,5 +29,5 @@ jobs: steps: - uses: actions/checkout@v3 - name: run bat - run: '& ./python/llm/portable-zip/setup.bat --ui' + run: '& cd ./python/llm/portable-zip; ./setup.bat --ui' shell: powershell diff --git a/python/llm/portable-zip/setup.bat b/python/llm/portable-zip/setup.bat index 056420adc6c..b509a2b2eb6 100644 --- a/python/llm/portable-zip/setup.bat +++ b/python/llm/portable-zip/setup.bat @@ -1,20 +1,20 @@ :: download python and extract zip -powershell -Command "Start-BitsTransfer -Source https://www.python.org/ftp/python/3.9.13/python-3.9.13-embed-amd64.zip -Destination .\python\llm\portable-zip\python-3.9.13-embed-amd64.zip" -powershell -Command "Expand-Archive .\python\llm\portable-zip\python-3.9.13-embed-amd64.zip -DestinationPath .\python\llm\portable-zip\python-embed" +powershell -Command "Start-BitsTransfer -Source https://www.python.org/ftp/python/3.9.13/python-3.9.13-embed-amd64.zip -Destination python-3.9.13-embed-amd64.zip" +powershell -Command "Expand-Archive .\python-3.9.13-embed-amd64.zip -DestinationPath .\python-embed" del .\python-3.9.13-embed-amd64.zip -set "python-embed=.\python\llm\portable-zip\python-embed\python.exe" +set "python-embed=.\python-embed\python.exe" :: download get-pip.py and install -powershell -Command "Invoke-WebRequest https://bootstrap.pypa.io/get-pip.py -OutFile .\python\llm\portable-zip\python-embed\get-pip.py" -%python-embed% .\python\llm\portable-zip\python-embed\get-pip.py +powershell -Command "Invoke-WebRequest https://bootstrap.pypa.io/get-pip.py -OutFile .\python-embed\get-pip.py" +%python-embed% .\python-embed\get-pip.py :: enable run site.main() automatically -@REM cd .\python\llm\portable-zip\python-embed +cd .\python-embed set "search=#import site" set "replace=import site" -powershell -Command "(gc .\python\llm\portable-zip\python-embed\python39._pth) -replace '%search%', '%replace%' | Out-File -encoding ASCII .\python\llm\portable-zip\python-embed\python39._pth" -@REM cd .. +powershell -Command "(gc python39._pth) -replace '%search%', '%replace%' | Out-File -encoding ASCII python39._pth" +cd .. :: install pip packages %python-embed% -m pip install --pre --upgrade bigdl-llm[all] @@ -29,4 +29,4 @@ if "%1"=="--ui" ( powershell -Command "Compress-Archive -Path '.\python-embed', '.\chat-ui.bat', '.\README.md' -DestinationPath .\bigdl-llm-ui.zip" ) else ( powershell -Command "Compress-Archive -Path '.\python-embed', '.\chat.bat', '.\chat.py', '.\README.md' -DestinationPath .\bigdl-llm.zip" -) +) \ No newline at end of file