mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-23 19:32:23 +00:00
enable ort-extensions in wasm release builds (#14239)
enable ort-extensions in wasm release builds. sentence piece, gpt2, bert and word piece tokenizers for now. wasm size will grow from 8.4MB to 8.9MB.
This commit is contained in:
parent
2db57a53a3
commit
60290393f3
2 changed files with 16 additions and 2 deletions
14
cmake/external/extensions.cmake
vendored
14
cmake/external/extensions.cmake
vendored
|
|
@ -21,6 +21,20 @@ if (onnxruntime_REDUCED_OPS_BUILD)
|
|||
set(OCOS_ENABLE_SELECTED_OPLIST ON CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
if (onnxruntime_WEBASSEMBLY_DEFAULT_EXTENSION_FLAGS)
|
||||
set(OCOS_ENABLE_SPM_TOKENIZER ON CACHE INTERNAL "")
|
||||
set(OCOS_ENABLE_GPT2_TOKENIZER ON CACHE INTERNAL "")
|
||||
set(OCOS_ENABLE_WORDPIECE_TOKENIZER ON CACHE INTERNAL "")
|
||||
set(OCOS_ENABLE_BERT_TOKENIZER ON CACHE INTERNAL "")
|
||||
set(OCOS_ENABLE_TF_STRING ON CACHE INTERNAL "")
|
||||
set(SPM_USE_BUILTIN_PROTOBUF OFF CACHE INTERNAL "")
|
||||
set(OCOS_ENABLE_STATIC_LIB ON CACHE INTERNAL "")
|
||||
set(OCOS_ENABLE_BLINGFIRE OFF CACHE INTERNAL "")
|
||||
set(OCOS_ENABLE_CV2 OFF CACHE INTERNAL "")
|
||||
set(OCOS_ENABLE_OPENCV_CODECS OFF CACHE INTERNAL "")
|
||||
set(OCOS_ENABLE_VISION OFF CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
# when onnxruntime-extensions is not a subdirectory of onnxruntime,
|
||||
# output binary directory must be explicitly specified.
|
||||
# and the output binary path is the same as CMake FetchContent pattern
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ stages:
|
|||
parameters:
|
||||
CommitOverride: true
|
||||
BuildConfig: 'Debug'
|
||||
ExtraBuildArgs: '$(ExtraBuildArgs)'
|
||||
ExtraBuildArgs: '--use_extensions --cmake_extra_defines onnxruntime_WEBASSEMBLY_DEFAULT_EXTENSION_FLAGS=ON $(ExtraBuildArgs)'
|
||||
PoolName: ${{ parameters.PoolName }}
|
||||
|
||||
- stage: Build_web_Debug
|
||||
|
|
@ -71,7 +71,7 @@ stages:
|
|||
parameters:
|
||||
CommitOverride: true
|
||||
BuildConfig: 'Release'
|
||||
ExtraBuildArgs: '--skip_tests --enable_wasm_api_exception_catching --disable_rtti $(ExtraBuildArgs)'
|
||||
ExtraBuildArgs: '--skip_tests --enable_wasm_api_exception_catching --disable_rtti --use_extensions --cmake_extra_defines onnxruntime_WEBASSEMBLY_DEFAULT_EXTENSION_FLAGS=ON $(ExtraBuildArgs)'
|
||||
PoolName: ${{ parameters.PoolName }}
|
||||
|
||||
- ${{ if eq(parameters.BuildStaticLib, 'true') }}:
|
||||
|
|
|
|||
Loading…
Reference in a new issue