From 8d865d195fd46e09c9a6fbd475053b02f9e9765b Mon Sep 17 00:00:00 2001 From: Manu Mehrotra <52586020+manuongithub@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:01:50 -0800 Subject: [PATCH] Update build.sh to make web tokenizer work with chrome extension web-llm's chrome extension not working with manifest version 3 and Google will be stopping manifest version 2 in January, 2024 The chrome extension isn't working because of use of evals in code. using -s NO_DYNAMIC_EXECUTION=1 removes eval() and new Function() from generated code refer: discussions in https://github.com/mlc-ai/web-llm/issues/214 --- web/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/build.sh b/web/build.sh index 10a6364..e4e048c 100755 --- a/web/build.sh +++ b/web/build.sh @@ -11,5 +11,5 @@ cd .. emcc --bind -o src/tokenizers_binding.js src/tokenizers_binding.cc\ build/libtokenizers_cpp.a build/libtokenizers_c.a build/sentencepiece/src/libsentencepiece.a\ - -O3 -s EXPORT_ES6=1 -s MODULARIZE=1 -s SINGLE_FILE=1 -s EXPORTED_RUNTIME_METHODS=FS -s ALLOW_MEMORY_GROWTH=1\ + -O3 -s EXPORT_ES6=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s NO_DYNAMIC_EXECUTION=1 -s MODULARIZE=1 -s SINGLE_FILE=1 -s EXPORTED_RUNTIME_METHODS=FS -s ALLOW_MEMORY_GROWTH=1\ -I../include