mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2024-11-07 08:34:37 +01: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
73 lines
1.5 KiB
CMake
73 lines
1.5 KiB
CMake
# dependencies
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
# third-party
|
|
|
|
if (WHISPER_SDL2)
|
|
# SDL2
|
|
find_package(SDL2 REQUIRED)
|
|
|
|
string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)
|
|
|
|
message(STATUS "SDL2_INCLUDE_DIRS = ${SDL2_INCLUDE_DIRS}")
|
|
message(STATUS "SDL2_LIBRARIES = ${SDL2_LIBRARIES}")
|
|
endif()
|
|
|
|
# common
|
|
|
|
set(TARGET common)
|
|
|
|
add_library(${TARGET} STATIC
|
|
common.h
|
|
common.cpp
|
|
common-ggml.h
|
|
common-ggml.cpp
|
|
)
|
|
|
|
include(DefaultTargetOptions)
|
|
|
|
target_link_libraries(${TARGET} PRIVATE whisper)
|
|
|
|
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
|
|
if (WHISPER_SDL2)
|
|
# common-sdl
|
|
|
|
set(TARGET common-sdl)
|
|
|
|
add_library(${TARGET} STATIC
|
|
common-sdl.h
|
|
common-sdl.cpp
|
|
)
|
|
|
|
include(DefaultTargetOptions)
|
|
|
|
target_include_directories(${TARGET} PUBLIC ${SDL2_INCLUDE_DIRS})
|
|
target_link_libraries(${TARGET} PRIVATE ${SDL2_LIBRARIES})
|
|
|
|
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
endif()
|
|
|
|
# examples
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
if (EMSCRIPTEN)
|
|
add_subdirectory(whisper.wasm)
|
|
add_subdirectory(stream.wasm)
|
|
add_subdirectory(command.wasm)
|
|
add_subdirectory(talk.wasm)
|
|
add_subdirectory(bench.wasm)
|
|
elseif(CMAKE_JS_VERSION)
|
|
add_subdirectory(addon.node)
|
|
else()
|
|
add_subdirectory(main)
|
|
add_subdirectory(stream)
|
|
add_subdirectory(command)
|
|
add_subdirectory(bench)
|
|
add_subdirectory(quantize)
|
|
add_subdirectory(talk)
|
|
add_subdirectory(talk-llama)
|
|
endif()
|