diff --git a/.github/workflows/bigdl-release-portable-executable-zip.yml b/.github/workflows/bigdl-release-portable-executable-zip.yml new file mode 100644 index 00000000000..be659968d6f --- /dev/null +++ b/.github/workflows/bigdl-release-portable-executable-zip.yml @@ -0,0 +1,41 @@ +name: BigDL Release Portable Executable Zip + +on: + push: + branches: [main] + paths: + - ".github/workflows/bigdl-release-portable-executable-zip.yml" + - "python/llm/portable-executable/**" + pull_request: + branches: [main] + paths: + - ".github/workflows/bigdl-release-portable-executable-zip.yml" + - "python/llm/portable-executable/**" + workflow_dispatch: + +jobs: + build-zip-cli: + runs-on: [self-hosted, llm, windows] + + steps: + - uses: actions/checkout@v3 + - name: run bat + run: '& cd ./python/llm/portable-zip; ./setup.bat' + shell: powershell + - uses: actions/upload-artifact@v3 + with: + name: portable-zip + path: ./python/llm/portable-zip/bigdl-llm.zip + + build-zip-gui: + runs-on: [self-hosted, llm, windows] + + steps: + - uses: actions/checkout@v3 + - name: run bat + run: '& cd ./python/llm/portable-zip; ./setup.bat --ui' + shell: powershell + - uses: actions/upload-artifact@v3 + with: + name: portable-zip + path: ./python/llm/portable-zip/bigdl-llm-ui.zip diff --git a/python/llm/portable-zip/chat.py b/python/llm/portable-zip/chat.py index cecf9700603..2eb69d268a1 100644 --- a/python/llm/portable-zip/chat.py +++ b/python/llm/portable-zip/chat.py @@ -43,6 +43,8 @@ import argparse import sys +sys.path.append(".") + # todo: support more model class from transformers import AutoModel, AutoModelForCausalLM, AutoTokenizer, AutoConfig from transformers import TextIteratorStreamer diff --git a/python/llm/portable-zip/setup.bat b/python/llm/portable-zip/setup.bat index b509a2b2eb6..f0d10e7b52e 100644 --- a/python/llm/portable-zip/setup.bat +++ b/python/llm/portable-zip/setup.bat @@ -26,7 +26,7 @@ if "%1"=="--ui" ( :: compress the python and scripts if "%1"=="--ui" ( - powershell -Command "Compress-Archive -Path '.\python-embed', '.\chat-ui.bat', '.\README.md' -DestinationPath .\bigdl-llm-ui.zip" + powershell -Command "Compress-Archive -Path '.\python-embed', '.\chat-ui.bat', '.\README-ui.md' -DestinationPath .\bigdl-llm-ui.zip" ) else ( - powershell -Command "Compress-Archive -Path '.\python-embed', '.\chat.bat', '.\chat.py', '.\README.md' -DestinationPath .\bigdl-llm.zip" + powershell -Command "Compress-Archive -Path '.\python-embed', '.\chat.bat', '.\chat.py', '.\kv_cache.py' , '.\README.md' -DestinationPath .\bigdl-llm.zip" ) \ No newline at end of file