From 8a6c7b44a30f4458a2fb414a1c98f4cf068c95f3 Mon Sep 17 00:00:00 2001 From: Abhishek Aggarwal Date: Wed, 12 May 2021 08:59:32 +0200 Subject: [PATCH] Avoid packaging vocab files into wasm binary in CI builds - We don't need to package vocab files into wasm binary any more as a sync with upstream enabled passing vocabs as bytes --- .circleci/config.yml | 2 +- build-wasm.sh | 20 +------------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6465469..69ae356 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ jobs: working_directory: build-wasm command: | ls -all bergamot* - if ls bergamot*.wasm &>/dev/null && ls bergamot*.js &>/dev/null && ls bergamot*.data &>/dev/null + if ls bergamot*.wasm &>/dev/null && ls bergamot*.js &>/dev/null then echo "Artifacts Successfully Generated" else diff --git a/build-wasm.sh b/build-wasm.sh index fff92a4..bdc00d5 100755 --- a/build-wasm.sh +++ b/build-wasm.sh @@ -37,24 +37,6 @@ if [ "$EMSDK" == "" ]; then source ./emsdk/emsdk_env.sh fi -# 3. Download models (required to perform inference using build artifacts) -if [ ! -d "bergamot-models" ]; then - git clone --depth 1 --branch main --single-branch https://github.com/mozilla-applied-ml/bergamot-models -else - cd bergamot-models - git fetch - # Only pull if necessary - if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]; then - git pull --ff-only - fi - cd - -fi -mkdir -p models -rm -rf models/* -cp -rf bergamot-models/prod/* models -gunzip models/*/* -find models \( -type f -name "model*" -or -type f -name "lex*" \) -delete - # 4. Compile # 1. Create a folder where you want to build all the artifacts (`build-wasm` in this case) if [ ! -d "build-wasm" ]; then @@ -63,7 +45,7 @@ fi cd build-wasm # 2. Compile the artifacts -emcmake cmake -DCOMPILE_WASM=on -DPACKAGE_DIR="../models/" ../ +emcmake cmake -DCOMPILE_WASM=on ../ emmake make -j3 # 3. Enable SIMD Wormhole via Wasm instantiation API in generated artifacts