From 7b0b10cf9802ffcfc0625e3001ab42aa4c46753a Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Tue, 24 Oct 2023 10:37:33 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20build=20script=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yaml | 1 + .github/workflows/preview.yaml | 1 + build.cmd | 7 ++++++- build.sh | 9 +++++++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2da656f83b..f616c60a19 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -108,6 +108,7 @@ jobs: pip install -r server/requirements.txt - name: Install tiktoken vocab file + # Done to avoid extra network request to download the vocab file run: | mkdir .tiktoken_cache curl -o .tiktoken_cache/9b5ad71b2ce5302211f9c61530b329a4922fc6a4 https://s3.us-west-1.amazonaws.com/s3.continue.dev/tiktoken/9b5ad71b2ce5302211f9c61530b329a4922fc6a4 diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index e299771ccf..0223723830 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -108,6 +108,7 @@ jobs: pip install -r server/requirements.txt - name: Install tiktoken vocab file + # Done to avoid extra network request to download the vocab file run: | mkdir .tiktoken_cache curl -o .tiktoken_cache/9b5ad71b2ce5302211f9c61530b329a4922fc6a4 https://s3.us-west-1.amazonaws.com/s3.continue.dev/tiktoken/9b5ad71b2ce5302211f9c61530b329a4922fc6a4 diff --git a/build.cmd b/build.cmd index 7e3128c583..3a6034c27f 100644 --- a/build.cmd +++ b/build.cmd @@ -5,6 +5,7 @@ rmdir /s /q build rmdir /s /q env rmdir /s /q dist rmdir /s /q server\.venv +rmdir /s /q .tiktoken_cache REM 2. Create a new virtual environment and activate it python -m venv env @@ -13,7 +14,11 @@ call env\Scripts\activate REM 3. Install the required packages pip install -r server\requirements.txt -pip install pyinstaller +pip install pyinstaller || exit /b 1 +pip install certifi || exit /b 1 + +REM 4.5. Make .tiktoken_cache directory, used to package with tiktoken vocab file +mkdir .tiktoken_cache REM 4. Call PyInstaller from within the virtual environment env\Scripts\pyinstaller continue_server.spec diff --git a/build.sh b/build.sh index 98c5131c0b..b94674a95a 100755 --- a/build.sh +++ b/build.sh @@ -5,14 +5,16 @@ rm -rf build rm -rf env rm -rf dist rm -rf server/.venv +rm -rf .tiktoken_cache # 2. Create a new virtual environment and activate it python3 -m venv env . env/bin/activate # 3. Install the required packages -pip install -r server/requirements.txt -pip install pyinstaller +pip install -r server/requirements.txt || exit 1 +pip install pyinstaller || exit 1 +pip install certifi || exit 1 # 4. Detect M1 architecture or allow manual override USE_ARCH="intel" @@ -33,6 +35,9 @@ else fi fi +# 4.5. Make .tiktoken_cache directory, used to package with tiktoken vocab file +mkdir .tiktoken_cache + # 5. Call PyInstaller from within the virtual environment env/bin/pyinstaller continue_server.spec -- --arch $USE_ARCH