Skip to content

Commit

Permalink
fix: setup.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
JinBridger committed Nov 1, 2023
1 parent 16f531a commit 236a038
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bigdl-release-portable-executable-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
18 changes: 9 additions & 9 deletions python/llm/portable-zip/setup.bat
Original file line number Diff line number Diff line change
@@ -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]
Expand 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"
)
)

0 comments on commit 236a038

Please sign in to comment.