]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
Merge tag 'upstream/1.7.4+203' into patch-queue/debian/latest
authorMathieu Baudier <redacted>
Tue, 11 Mar 2025 14:36:22 +0000 (15:36 +0100)
committerMathieu Baudier <redacted>
Tue, 11 Mar 2025 15:22:58 +0000 (16:22 +0100)
1  2 
debian/changelog
debian/cmake/debian-whisper.cpp.cmake
debian/patches/0001-disable-some-examples.patch
debian/patches/0003-load-ggml-backends.patch
debian/patches/0004-load-ggml-backends-cli.patch
debian/patches/0004-use-llama-cpp-library.patch
debian/patches/series

index 8fc9b9d2664a59711e61ef5d265cf3050aca79e7,0000000000000000000000000000000000000000..534e55aced75f08d17fd48e0f90da678f8f947c7
mode 100644,000000..100644
--- /dev/null
@@@ -1,5 -1,0 +1,5 @@@
- whisper-cpp (1.7.4+95-2) unstable; urgency=medium
++whisper-cpp (1.7.4+203-1) unstable; urgency=medium
 +
-   * Improve packaging based on mentoring feedback
++  * Update upstream
 +
-  -- Mathieu Baudier <mbaudier@argeo.org>  Sun, 23 Feb 2025 11:39:50 +0000
++ -- Mathieu Baudier <mbaudier@argeo.org>  Tue, 11 Mar 2025 14:06:57 +0000
index e9b7025d94875e5cb53a09f230f96e3aa33c4a7c,0000000000000000000000000000000000000000..1bc06cfff46558b8c5029bd4d261a3a4aa79a73b
mode 100644,000000..100644
--- /dev/null
@@@ -1,42 -1,0 +1,30 @@@
- # libwhisper actually link against a CPU backend
- #find_library(GGML_CPU_LOCATION ggml-cpu)
- # FIXME better way to find CPU backend
- set(GGML_CPU_LOCATION /usr/libexec/${CMAKE_LIBRARY_ARCHITECTURE}/ggml/libggml-cpu-sandybridge.so)
- message (STATUS "Found GGML CPU library: ${GGML_CPU_LOCATION}")
- link_libraries(${GGML_CPU_LOCATION})
- # Not clear whether a libggml-cpu is actually needed.
- # LD_LIBRARY_PATH=/usr/libexec/*/ggml would have to be used in that case
- # It could be more robust to set RPATH, but it causes lintian errors:
- #set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/libexec/${CMAKE_LIBRARY_ARCHITECTURE}/ggml")
 +cmake_minimum_required(VERSION 3.14) # for add_link_options and implicit target directories.
 +
 +include(GNUInstallDirs)
 +include(CMakePackageConfigHelpers)
 +
 +# GGML dependencies
 +if (NOT TARGET ggml)
 +# libggml-base as external library
 +find_library(GGML_BASE_LOCATION ggml-base)
 +message (STATUS "Found GGML base library: ${GGML_BASE_LOCATION}") 
 +add_library(ggml-base SHARED IMPORTED GLOBAL)
 +set_target_properties(ggml-base PROPERTIES IMPORTED_LOCATION ${GGML_BASE_LOCATION})
 +
 +# libggml as external library
 +# defines GGML as target so that it is disabled in whisper.cpp build
 +find_library(GGML_LOCATION ggml)
 +message (STATUS "Found GGML library: ${GGML_LOCATION}") 
 +add_library(ggml SHARED IMPORTED GLOBAL)
 +set_target_properties(ggml PROPERTIES IMPORTED_LOCATION ${GGML_LOCATION})
 +# transitive dependency
 +target_link_libraries(ggml INTERFACE ${GGML_BASE_LOCATION})
 +endif()
 +
 +add_compile_definitions(NDEBUG)
 +
 +
 +# install common
 +install(DIRECTORY ${CMAKE_BINARY_DIR}/examples/ DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}/whisper.cpp/common FILES_MATCHING PATTERN "libcommon*.a" )
 +install(DIRECTORY ${CMAKE_SOURCE_DIR}/examples/ DESTINATION include/whisper.cpp/common FILES_MATCHING PATTERN "common*.h" )
 +
index c8b7525682cf4bfafa99d8a92dfad442a35adc56,0000000000000000000000000000000000000000..c4cc5880ac7b3d351568a351ddea70acd8bc4b94
mode 100644,000000..100644
--- /dev/null
@@@ -1,42 -1,0 +1,42 @@@
- index d509626..6d0ba25 100644
 +From: Mathieu Baudier <mbaudier@argeo.org>
 +Date: Mon, 27 Jan 2025 08:08:56 +0100
 +Subject: disable-some-examples
 +
 +Disable some unused examples
 +---
 + examples/CMakeLists.txt | 12 ++++++------
 + 1 file changed, 6 insertions(+), 6 deletions(-)
 +
 +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
- @@ -104,16 +104,16 @@ elseif(CMAKE_JS_VERSION)
++index e1b083d..3d45d4c 100644
 +--- a/examples/CMakeLists.txt
 ++++ b/examples/CMakeLists.txt
- @@ -121,5 +121,5 @@ else()
++@@ -102,16 +102,16 @@ elseif(CMAKE_JS_VERSION)
 +     add_subdirectory(addon.node)
 + else()
 +     add_subdirectory(cli)
 +-    add_subdirectory(bench)
 +-    add_subdirectory(server)
 +-    add_subdirectory(quantize)
 ++    #add_subdirectory(bench)
 ++    #add_subdirectory(server)
 ++    #add_subdirectory(quantize)
 +     if (WHISPER_SDL2)
 +         add_subdirectory(stream)
 +         add_subdirectory(command)
 +         add_subdirectory(talk-llama)
 +-        add_subdirectory(lsp)
 ++        #add_subdirectory(lsp)
 +         if (GGML_SYCL)
 +-            add_subdirectory(sycl)
 ++            #add_subdirectory(sycl)
 +         endif()
 +     endif (WHISPER_SDL2)
 + 
++@@ -119,5 +119,5 @@ else()
 + endif()
 + 
 + if (WHISPER_SDL2)
 +-    add_subdirectory(wchess)
 ++    #add_subdirectory(wchess)
 + endif (WHISPER_SDL2)
index da11d079c54f3aa49635032e710214d3dde874a3,0000000000000000000000000000000000000000..8be3db12a19ccd804448c826c8fdd7de583bb7c6
mode 100644,000000..100644
--- /dev/null
@@@ -1,25 -1,0 +1,25 @@@
- index dcdaec4..43bd58b 100644
 +From: Mathieu Baudier <mbaudier@argeo.org>
 +Date: Mon, 27 Jan 2025 09:34:50 +0100
 +Subject: load-ggml-backends
 +
 +Make sure GGML backends are loaded in talk-llama
 +---
 + examples/talk-llama/talk-llama.cpp | 5 ++++-
 + 1 file changed, 4 insertions(+), 1 deletion(-)
 +
 +diff --git a/examples/talk-llama/talk-llama.cpp b/examples/talk-llama/talk-llama.cpp
- @@ -272,7 +272,10 @@ The transcript only includes text, it does not include markup like HTML and Mark
++index 9097c49..f12a82c 100644
 +--- a/examples/talk-llama/talk-llama.cpp
 ++++ b/examples/talk-llama/talk-llama.cpp
++@@ -273,7 +273,10 @@ The transcript only includes text, it does not include markup like HTML and Mark
 + {0}{4})";
 + 
 + int main(int argc, char ** argv) {
 +-    whisper_params params;
 ++     // make sure GGML backends are loaded
 ++     ggml_backend_load_all();
 ++
 ++     whisper_params params;
 + 
 +     if (whisper_params_parse(argc, argv, params) == false) {
 +         return 1;
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..b5c8f4533e2c2ae6ea3c66c3826817270a57de2a
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,22 @@@
++From: Mathieu Baudier <mbaudier@argeo.org>
++Date: Tue, 11 Mar 2025 16:22:18 +0100
++Subject: load-ggml-backends-cli
++
++---
++ examples/cli/cli.cpp | 3 +++
++ 1 file changed, 3 insertions(+)
++
++diff --git a/examples/cli/cli.cpp b/examples/cli/cli.cpp
++index a84d3cb..d891c82 100644
++--- a/examples/cli/cli.cpp
+++++ b/examples/cli/cli.cpp
++@@ -929,6 +929,9 @@ int main(int argc, char ** argv) {
++     SetConsoleOutputCP(CP_UTF8);
++ #endif
++ 
+++     // make sure GGML backends are loaded
+++     ggml_backend_load_all();
+++
++     whisper_params params;
++ 
++     // If the only argument starts with "@", read arguments line-by-line
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..004fa9856debe7112b270f31174c376c8b15b11b
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,46 @@@
++From: Mathieu Baudier <mbaudier@argeo.org>
++Date: Tue, 11 Mar 2025 15:40:11 +0100
++Subject: use-llama-cpp-library
++
++---
++ examples/talk-llama/CMakeLists.txt | 25 ++++---------------------
++ 1 file changed, 4 insertions(+), 21 deletions(-)
++
++diff --git a/examples/talk-llama/CMakeLists.txt b/examples/talk-llama/CMakeLists.txt
++index aea1ae6..f86a338 100644
++--- a/examples/talk-llama/CMakeLists.txt
+++++ b/examples/talk-llama/CMakeLists.txt
++@@ -3,29 +3,12 @@ if (WHISPER_SDL2)
++     set(CMAKE_CXX_STANDARD_REQUIRED ON)
++ 
++     set(TARGET whisper-talk-llama)
++-    add_executable(${TARGET} talk-llama.cpp
++-        llama.cpp
++-        llama-adapter.cpp
++-        llama-arch.cpp
++-        llama-batch.cpp
++-        llama-chat.cpp
++-        llama-context.cpp
++-        llama-cparams.cpp
++-        llama-grammar.cpp
++-        llama-hparams.cpp
++-        llama-impl.cpp
++-        llama-kv-cache.cpp
++-        llama-mmap.cpp
++-        llama-model-loader.cpp
++-        llama-model.cpp
++-        llama-quant.cpp
++-        llama-sampling.cpp
++-        llama-vocab.cpp
++-        unicode.cpp
++-        unicode-data.cpp)
+++    add_executable(${TARGET} talk-llama.cpp)
++     target_include_directories(${TARGET} PRIVATE ${SDL2_INCLUDE_DIRS})
++ 
++-    target_link_libraries(${TARGET} PRIVATE common common-sdl whisper ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+++    target_link_libraries(${TARGET} PRIVATE common common-sdl whisper llama ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+++
+++     install(TARGETS ${TARGET} RUNTIME)
++ 
++     if(WIN32)
++         # It requires Windows 8.1 or later for PrefetchVirtualMemory
index aef67717d14f5011c5c25f23178705f46122f4e6,0000000000000000000000000000000000000000..51c4c7bd91e22af0dd4a02d753b9da161124b681
mode 100644,000000..100644
--- /dev/null
@@@ -1,3 -1,0 +1,4 @@@
- 0002-use-llama-cpp-library.patch
 +0001-disable-some-examples.patch
 +0003-load-ggml-backends.patch
++0004-use-llama-cpp-library.patch
++0004-load-ggml-backends-cli.patch