]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
Rediff patches
authorMathieu Baudier <redacted>
Mon, 27 Jan 2025 07:10:05 +0000 (08:10 +0100)
committerMathieu Baudier <redacted>
Mon, 27 Jan 2025 07:10:05 +0000 (08:10 +0100)
Add 0002-use-llama-cpp-library.patch: <REASON>
Add 0001-disable-some-examples.patch: <REASON>
Drop 0001-filter-examples.patch: <REASON>
Drop 0002-talk-llama-use-library.patch: <REASON>

debian/patches/0001-disable-some-examples.patch [new file with mode: 0644]
debian/patches/0001-filter-examples.patch [deleted file]
debian/patches/0002-talk-llama-use-library.patch [deleted file]
debian/patches/0002-use-llama-cpp-library.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/0001-disable-some-examples.patch b/debian/patches/0001-disable-some-examples.patch
new file mode 100644 (file)
index 0000000..c8b7525
--- /dev/null
@@ -0,0 +1,42 @@
+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
+index d509626..6d0ba25 100644
+--- a/examples/CMakeLists.txt
++++ b/examples/CMakeLists.txt
+@@ -104,16 +104,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)
+@@ -121,5 +121,5 @@ else()
+ endif()
+ if (WHISPER_SDL2)
+-    add_subdirectory(wchess)
++    #add_subdirectory(wchess)
+ endif (WHISPER_SDL2)
diff --git a/debian/patches/0001-filter-examples.patch b/debian/patches/0001-filter-examples.patch
deleted file mode 100644 (file)
index 0a30acf..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Mathieu Baudier <mbaudier@argeo.org>
-Date: Wed, 22 Jan 2025 07:41:21 +0100
-Subject: filter-examples
-
-Disable building examples which are problematic or unnecessary.
----
- examples/CMakeLists.txt | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
-index d509626..6435959 100644
---- a/examples/CMakeLists.txt
-+++ b/examples/CMakeLists.txt
-@@ -104,16 +104,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(talk-llama)
-+        #add_subdirectory(lsp)
-         if (GGML_SYCL)
--            add_subdirectory(sycl)
-+            #add_subdirectory(sycl)
-         endif()
-     endif (WHISPER_SDL2)
diff --git a/debian/patches/0002-talk-llama-use-library.patch b/debian/patches/0002-talk-llama-use-library.patch
deleted file mode 100644 (file)
index e308bf2..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-From: Mathieu Baudier <mbaudier@argeo.org>
-Date: Wed, 22 Jan 2025 09:01:06 +0100
-Subject: talk-llama-use-library
-
-Use llama.cpp library to build whisper-talk-llama.
----
- examples/CMakeLists.txt            |  2 +-
- examples/talk-llama/CMakeLists.txt | 11 +++--------
- 2 files changed, 4 insertions(+), 9 deletions(-)
-
-diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
-index 6435959..5d66015 100644
---- a/examples/CMakeLists.txt
-+++ b/examples/CMakeLists.txt
-@@ -110,7 +110,7 @@ else()
-     if (WHISPER_SDL2)
-         add_subdirectory(stream)
-         add_subdirectory(command)
--        #add_subdirectory(talk-llama)
-+        add_subdirectory(talk-llama)
-         #add_subdirectory(lsp)
-         if (GGML_SYCL)
-             #add_subdirectory(sycl)
-diff --git a/examples/talk-llama/CMakeLists.txt b/examples/talk-llama/CMakeLists.txt
-index ce51660..829c4f6 100644
---- a/examples/talk-llama/CMakeLists.txt
-+++ b/examples/talk-llama/CMakeLists.txt
-@@ -1,18 +1,13 @@
- if (WHISPER_SDL2)
-     set(TARGET whisper-talk-llama)
--    add_executable(${TARGET} talk-llama.cpp
--        llama.cpp
--        llama-vocab.cpp
--        llama-grammar.cpp
--        llama-sampling.cpp
--        unicode.cpp
--        unicode-data.cpp)
-+    add_executable(${TARGET} talk-llama.cpp)
-     target_include_directories(${TARGET} PRIVATE ${SDL2_INCLUDE_DIRS})
-     if (WHISPER_CLBLAST)
-         set(CLBLAST_LIBNAME clblast)
-     endif ()
--    target_link_libraries(${TARGET} PRIVATE common common-sdl whisper ${SDL2_LIBRARIES} ${CLBLAST_LIBNAME} ${CMAKE_THREAD_LIBS_INIT})
-+    target_link_libraries(${TARGET} PRIVATE common common-sdl whisper llama ${SDL2_LIBRARIES} ${CLBLAST_LIBNAME} ${CMAKE_THREAD_LIBS_INIT})
-+    install(TARGETS ${TARGET} RUNTIME)
-     if(WIN32)
-         # It requires Windows 8.1 or later for PrefetchVirtualMemory
diff --git a/debian/patches/0002-use-llama-cpp-library.patch b/debian/patches/0002-use-llama-cpp-library.patch
new file mode 100644 (file)
index 0000000..c5de955
--- /dev/null
@@ -0,0 +1,49 @@
+From: Mathieu Baudier <mbaudier@argeo.org>
+Date: Mon, 27 Jan 2025 08:09:55 +0100
+Subject: use-llama-cpp-library
+
+Use llma.cpp shared library to build talk-llama
+---
+ examples/talk-llama/CMakeLists.txt | 24 +++---------------------
+ 1 file changed, 3 insertions(+), 21 deletions(-)
+
+diff --git a/examples/talk-llama/CMakeLists.txt b/examples/talk-llama/CMakeLists.txt
+index c15c6b5..c975d42 100644
+--- a/examples/talk-llama/CMakeLists.txt
++++ b/examples/talk-llama/CMakeLists.txt
+@@ -3,32 +3,14 @@ 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})
+     if (WHISPER_CLBLAST)
+         set(CLBLAST_LIBNAME clblast)
+     endif ()
+-    target_link_libraries(${TARGET} PRIVATE common common-sdl whisper ${SDL2_LIBRARIES} ${CLBLAST_LIBNAME} ${CMAKE_THREAD_LIBS_INIT})
++    target_link_libraries(${TARGET} PRIVATE common common-sdl whisper llama ${SDL2_LIBRARIES} ${CLBLAST_LIBNAME} ${CMAKE_THREAD_LIBS_INIT})
++    install(TARGETS ${TARGET} RUNTIME)
+     if(WIN32)
+         # It requires Windows 8.1 or later for PrefetchVirtualMemory
index 29237a9b95b912279df1077c3e47484031fd7fe0..86cf8d361759a112fc824624efd9c7b630fffd0d 100644 (file)
@@ -1,2 +1,2 @@
-0001-filter-examples.patch
-0002-talk-llama-use-library.patch
+0001-disable-some-examples.patch
+0002-use-llama-cpp-library.patch