mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2024-12-18 20:27:53 +00:00
794b162a46
* whisper : add integer quantization support * examples : add common-ggml + prepare to add "quantize" tool * whisper : quantization tool ready * whisper : fix F32 support * whisper : try to fix shared lib linkage * wasm : update quantized models to Q5 * bench.wasm : remove "medium" button * bench.wasm : fix custom model button * ggml : add Q5_0 and Q5_1 WASM SIMD * wasm : add quantized models to all WASM examples * wasm : bump DB version number to 2 * talk-llama : update example to latest llama.cpp * node : increase test timeout to 10s * readme : add information for model quantization * wasm : add links to other examples
52 lines
1.1 KiB
CMake
52 lines
1.1 KiB
CMake
#
|
|
# libtalk
|
|
#
|
|
|
|
set(TARGET libtalk)
|
|
|
|
add_executable(${TARGET}
|
|
emscripten.cpp
|
|
gpt-2.cpp
|
|
)
|
|
|
|
include(DefaultTargetOptions)
|
|
|
|
target_link_libraries(${TARGET} PRIVATE
|
|
whisper
|
|
common
|
|
)
|
|
|
|
unset(EXTRA_FLAGS)
|
|
|
|
if (WHISPER_WASM_SINGLE_FILE)
|
|
set(EXTRA_FLAGS "-s SINGLE_FILE=1")
|
|
message(STATUS "Embedding WASM inside talk.js")
|
|
|
|
add_custom_command(
|
|
TARGET ${TARGET} POST_BUILD
|
|
COMMAND ${CMAKE_COMMAND} -E copy
|
|
${CMAKE_BINARY_DIR}/bin/libtalk.js
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/talk.wasm/talk.js
|
|
)
|
|
endif()
|
|
|
|
set_target_properties(${TARGET} PROPERTIES LINK_FLAGS " \
|
|
--bind \
|
|
-s USE_PTHREADS=1 \
|
|
-s PTHREAD_POOL_SIZE=8 \
|
|
-s INITIAL_MEMORY=1800MB \
|
|
-s TOTAL_MEMORY=1800MB \
|
|
-s FORCE_FILESYSTEM=1 \
|
|
-s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap']\" \
|
|
${EXTRA_FLAGS} \
|
|
")
|
|
|
|
#
|
|
# talk.wasm
|
|
#
|
|
|
|
set(TARGET talk.wasm)
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/index-tmpl.html ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET}/index.html @ONLY)
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../helpers.js ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET}/helpers.js @ONLY)
|